[Catalyst-dev] [RFC] Template and Static directory locations

John Wang johncwang at gmail.com
Mon Oct 23 19:00:58 GMT 2006


On 10/23/06, Jesse Sheidlower <jester at panix.com> wrote:
>
> On Mon, Oct 23, 2006 at 10:38:38AM -0700, John Wang wrote:
> > I think it makes some sense to create a directory convention with more
> > meanining say:
> >
> > MyApp/tmpl or MyApp/templates for templates
> >
> > MyApp/htdocs or MyApp/public for static and other files
> >
> > These directory names would make cat a lot more user friendly for new
> users
> > and have more intrinsic meaning.
> >
> > I avoided MyApp/static because one advantage of having a ./htdocs or
> > ./public directory is that you can put a .htaccess and index.fcgi in it
> and
> > then just point your web server to that directory. This would make it
> easier
> > to get some apps up and running.
>
> I don't agree with this. I think the meaning of "static" is
> extremely, perfectly clear. You can put other levels under
> it--/static/images/, /static/html, /static/js, whatever.
> But "static" says _exactly_ what it is.
>
> "htdocs" may have an advantage for some Apache purposes but
> it's otherwise totally opaque; even people who use Apache
> regularly might not know what it means.  And it shares with
> "public" the problem of not specifying exactly what it is
> you're using it for. "public" suggests a certain level of
> access restrictions, not a static/dynamic disparity, for
> example.


I don't think htdocs/public is very ambiguous because it's used all the time
in Apache and Rails, but it'd be good to hear more opinions. Also the
htdocs/public directory wouldn't be Apache specific since it can be used by
lighttpd and other web servers in exactly the same way.

One question is whether it makes sense to have such a directory at all.
Rails has this which lets you put in a .fcgi script along with images, css,
js, etc. This feature has been mentioned has useful by others in
#catalyst-dev. If having this functionality makes sense, having a separate
directory for static and dynamic assets which are both designed to be
rendered by the web server seems excessive to me, but perhaps not.

If we go the route of having an explicit static directory instead of
htdocs/public I think it may make sense to have a top-level assets directory
because that's what they both are:

MyApp/assets/static
MyApp/assets/tmpl

-- =

John Wang
http://www.dev411.com/blog/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jules.scsys.co.uk/pipermail/catalyst-dev/attachments/20061023/b=
bfafb4c/attachment.htm


More information about the Catalyst-dev mailing list