On Jun 13, 2007, at 10:39 AM, John W. Long wrote:

> Oliver Baltzer wrote:
>> thanks for your input. I do not think that the file extension is in
>> the general case a good indication for whether a URL should have a
>> trailing slash or not [1]. The canonical URL of a resource should be
>> determined by its corresponding model. ATM, everything in Radiant  
>> is a
>> page whether it is HTML or CSS. I would suggest the site controller
>> uses Page#url to determine the canonical URL of a page and redirects
>> accordingly. Page#url or any derived form of it is then  
>> responsible of
>> deciding if a trailing slash should be added. If we then want to have
>> CSS and XML without trailing slashes, we can just add a new derived
>> page model that computes the canonical URL differently.
>
> I'm fine with it being implemented through Page#url, but I would  
> suggest
> that the default implementation check the file extension to  
> determine if
> the trailing slash is necessary.

I'm not.  It suggests that there is only one URL to access a page,  
and that may not be the case.

My example:

/  (Virtual Domain Page)
/main-site
/main-site/site.css
/other-site
/other-site/site.css
/other-site/main.css (Alias Page) (to /main-site/site.css)

This would allow certain pages in the "other site" to look like the  
main site (an organizational theme to override a site theme, for  
example).  However, doing Page.find_by_url('/main.css').url (from the  
other-site host) will return "site.css", which is horribly  
incorrect.  Perhaps I'm being overly cautious, but I don't think that  
Radiant should enforce a redirect to the "one true URL" anywhere.  It  
seems to seriously limit extensions.

That said, I do think that the trailing slash addition or removal is  
useful.  Personally, I think of a radiant page similarly to the  
index.html of a directory in most cases.  (So a sibling is actually  
"../sibling".)  YMMV.  Adding .html to the slug of pages that  
shouldn't be directories (or a trailing slash to those that should)  
isn't a bad idea, I think.

~~ Brian
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to