startling / cytoplasm

A static site generator written in python.
MIT License
13 stars 0 forks source link

mako interpreter can't find template unless you're in the site directory #12

Open startling opened 12 years ago

startling commented 12 years ago

You can see why here; basically I have the mako interpreter tell mako where to find templates by having the current directory (.) in the TemplateLookup. This fails if you build the site if you're not in the site directory with something like

mako.exceptions.TemplateLookupException: Cant locate template for uri u'/_templates/site.mako'

This is also why cytoplasm serve -r is temporarily broken: it chdirs to the build directory and then builds the site given the absolute path because of how the SimpleHTTPServer works.

This is slightly complicated to fix because the configuration file doesn't get the Site object, so it can't look up the full source directory.

There are a couple ways I could fix this:

Any other ideas?

startling commented 12 years ago

Not sure whether this counts as a clever fix or working around the problem. I'll keep this open for a little bit.

luca-vercelli commented 6 years ago

A little bit?