Anomareh/mynt — Issue #9: Rendering "pages" not working
Author: andrew-d
Created: 2012-03-03 08:44:57+00:00
State: open

Hey,

When rendering pages, mynt breaks with a "Template not found" error. The problem seems to be that the Jinja2 search path isn't picking up the template, as the search path is always the "_templates" directory.

It can be seen by installing mynt on a Windows machine, and then cloning your blog (https://github.com/Anomareh/MirroredWhite) and running mynt -v _deploy. The error is, exactly:

$ mynt -v _dest
>> Initializing
.. src: c:\Temp\tmp\MirroredWhite
.. dest: c:\Temp\tmp\MirroredWhite\_dest
>> Searching for config
.. found: c:\Temp\tmp\MirroredWhite\config.yml
>> Parsing
.. src: c:\Temp\tmp\MirroredWhite\_posts
.. 2010-08-16-Messing-around-with-Irssi-and-LiteStep..md
.. 2011-04-06-So-this-blogging-thing..md
.. 2011-11-18-I-spend-too-much-time-thinking-about-post-titles..md
.. 2012-01-02-I-almost-upped-my-posts-per-year-to-3-and-a-mynty-fresh-start-to-2012..md
.. 2012-01-25-From-1-project-comes-2-more..md
>> Processing
.. ordering posts
.. generating archives
.. sorting tags
>> Rendering
.. posts
.. pages
!! Template not found.

I've monkey-patched mynt to print the search path, and it gives this:

getting loader: post.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
getting loader: layout.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
getting loader: page.header.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
getting loader: modules/what.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
getting loader: module.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
getting loader: modules/where.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']

getting loader: modules/who.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
.. pages
-> 404.html
getting loader: 404.html [u'c:\\Temp\\tmp\\MirroredWhite\\_templates']
!! Template not found.

As can be seen, the search path for pages in the root directory is invalid.

Best Regards.