Just a few questions about pylons programming style.

1) h.url_for is a great idiom to generate urls to dynamic
   pages. But what should be used to generate links to
   *static* resources? There is h.stylesheet_link_tag,
   but what should I use to generate links to static HTML,
   images, binary files etc?

2) Why split between ./public and ./templates? I find it
   somewhat confusing, it is usually easier to keep images
   together with the templates which refer to them...
   Is it possible to have static controller serving some
   files, and template controller handling other files
   from the same directory hierarchy (using file
   extensions to choose)? Or maybe some other idiom
   should be applied?

3) What is the typical approach to generate things like
   table of contents, page-list menu etc. Do people tend
   to write such things manually? If I would like to
   scan my package for files and generate indexes automatically,
   should I use pkg_resources, os, or sth else?

4) What about search? Can you recommend some library which
   would allow to implement simple search thorough small
   site without using google?

5) How would you implement simple constants referred thorough
   the site in different templates? At the moment I have sth
   like
        _const.mako
          <%def name="author_name()" buffered="True">Marcin Kasperski</%def>
          ...
   and in actual pages
       <%namespace file="_const.html" name="const"/>
       ...
       Autor: ${author_name()}
   But ... using functions for simple constants seems to be
   overkill. And it seems mako does not handle exporting
   non-functions, I can write
       <%! author_name = u'Marcin Kasperski' %>
   in _const.mako, but I am not able to refer to this variable from
   other templates.

Thanks in advance for any reply.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to