Interesting, I'll take a look at this some more. My only question is, isn't plain old Lua already like django's templates. What specifically are you adding that embedded lua doesn't just give you?
`Template inheritance¶
The most powerful -- and thus the most complex -- part of
Django's template engine is template inheritance. Template
inheritance allows you to build a base "skeleton" template
that contains all the common elements of your site and
defines blocks that child templates can override.`
Having made it in lua myself, I can tell you it is indeed quite complex. ;)
The lua template only has "include" (i.e. copying another template into this template), but not "extends", (i.e. use another template as a skeleton and this template only provides details on how to fill it).
Well, I only did what I needed, but since Lua's included code blocks are also functional, wouldn't it be easier to just allow passing arguments? It'd also make a lot more sense. I find Django/Jinja inheritance concepts really confusing.
I'll take a look at the code and see what I can come up with.
If you wanted, say, your about page to have an extra image next to the logo (as an exception to all the other pages), then you'd have to rewrite another header file to include, whereas if you used template inheritance you could just override that logo part without having another almost identical header file.
It may be confusing if you're new to it... but so are OOP, Lambda calculus, and others. ;)
EDIT: The code isn't that clean... Apologies in advance.
Not with the same notion of inheritance that django templates have (with multiple blocks that can be overridden in child classes). There is one project someone attempted but never finished.