Closed leouieda closed 8 years ago
Is it possible to avoid the duplication of code? From the documentation I understand there is also a jinja2.Undefined
value for the default behavior. In that case, it is a matter of setting up the undefined
argument correctly.
This should be documented in http://urubu.jandecaluwe.com/manual/structure.html#_siteyml currently. (At some point I may factor out the configuration info in a separate chapter).
@jandecaluwe I have refactored out the duplicate code and wrote a sentence or two describing the new attribute.
Is there a reason why the built HTML files are committed to master
? Should I add my updated build files?
Thanks. I use the docs as part of my tests, ad-hoc as I change things, and in the regression suite. That's why I commit them locally. From master I do a git subtree push to the gh-pages
branch.
OK, I thought it was something like that.
I liked using this flag because it caught a lot of errors in my template that were silently being left blank.
If a variable is missing from a template, the current behavior of urubu is to treat it as an empty string. So if you forget to define (or define it wrong), the resulting HTML will be empty and you might not realize it.
This adds an optional argument to
_site.yml
calledstrict_undefined
. If omitted orfalse
, urubu behaves normally. If defined andtrue
, then will addundefined=jinja2.StrictUndefined
tojinja2.Environment
and jinja will fail with an error when an undefined variable is encountered.I haven't added this to the docs. If you think it's a good option to have, then I'd welcome some pointers as to where I should document this.