jinja relative paths

17 views
Skip to first unread message

Deepak Sarda

unread,
Dec 13, 2006, 2:31:37 AM12/13/06
to colubri...@googlegroups.com
[ I posted this through the google groups web interface some days ago
but that message seems to have disappeared into a black hole :-( ]

Hi,

I am trying to use relative paths in Jinja but they don't work.

{% extends "../layouts/foo" %}

The culprit is the name mangling in FileSystemLoader.load()

http://trac.pocoo.org/browser/jinja/trunk/jinja/loader.py?rev=1900#L70:

name = os.sep.join([p for p in name.split(os.sep) if p and p[0] != '.'])

What's happening here? :-)

Is the intention just to remove the filename suffix/extension so that
the specified suffix can be appended? If that's the case, then that
line could be replaced with something that doesn't break relative paths.

If there's some other thing the above line is trying to accomplish,
please explain :-)

Cheers,

Deepak

--
http://antrix.net/

Reply all
Reply to author
Forward
0 new messages