You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently haiku treats anything in site.content as if it were text and needs to be parsed by mustache.
To support the Rocket.ly use case of having everything in content directory (i.e. not needing to have a separate public directory) I think we can add a configuration option like:
defaultTemplateEngine: false
Which would turn off the behavior of assuming mustache is okay to run on any files in the content directory and only use a parser if it is called for in the file's name. So with defaultTemplateEngine set to false a directory like this:
Would only have the about.md.mustache file run through Mustache and Markdown, the other would be left alone.
Also having a defaultTemplateEngine will allow one to set their default engine to Handlebars for instance once we add support for it and not require the .handlebars extension added to the end of every file
The text was updated successfully, but these errors were encountered:
I like this. Nice way for everyone to get what they want without making things awkward.
By the same token, I think we might want to have some sort of template registry that is exposed and can be modified in the config. And then we can have a mapping of extension to engine. So that way, you can decide to just use, say, .hb for handlebars templates.
I have a hacked version of this working in the default-template-parser branch but ran into a caveat. File encoding :(
We need to know the file encoding before reading the files into the page objects and before writing the files out in the build and deploy process. Otherwise things like the favicon.ico will not be read or written properly using this example.
Currently haiku treats anything in
site.content
as if it were text and needs to be parsed by mustache.To support the Rocket.ly use case of having everything in content directory (i.e. not needing to have a separate public directory) I think we can add a configuration option like:
Which would turn off the behavior of assuming mustache is okay to run on any files in the content directory and only use a parser if it is called for in the file's name. So with
defaultTemplateEngine
set tofalse
a directory like this:Would only have the about.md.mustache file run through Mustache and Markdown, the other would be left alone.
Also having a
defaultTemplateEngine
will allow one to set their default engine to Handlebars for instance once we add support for it and not require the .handlebars extension added to the end of every fileThe text was updated successfully, but these errors were encountered: