Hi,
I'm considering Nunjucks for building simple html previews of static designs. I was considering Handlebars but the lack of inheritance is a no-go.
The idea is:
- base.html with blocks for custom components
- layout-*.html extends base.html, blocks import...
- component-*.html which has only flat html for design preview (for example the page header)
My idea is to have a nice and fast way to build flexible previews by defining different layouts and then rendering them to static html files that the designer and/or client could view.
This is quite similar to running a static html generator like Jekyll and I would even use it as the use case is really simple but we don't want the overhead of Ruby. Also we want to keep it as generic as possible to easily use it for generating previews for other projects too.
We decided on using Grunt.js for coordinating the preview building because the asset structure will probably vary from client to client.
Given the background I have some questions:
1. How to render the layout-*.html templates to ordinary static html files?
2. Is there any easy way to render the files with Grunt.js?
I'm open for suggestions and questions if anything needs more detail :).