Hello.
Apologies for bumping an ancient thread. However, I looked at the code for this and it would be very simple to implement in a reverse-compatible way, which I would be willing to submit as a PR if it is agreeable, since I find it personally quite useful.
- Add an option to the Config main section called
template_extensions, with the typeVec<String>and a default value ofvec. - Update the template glob pattern to use this configuration value instead of the hardcoded extensions (
components/templates/src/lib.rs). - Update the Configuration doc page to reflect the added option (
docs/content/documentation/getting-started/configuration.md). - Add the
filenamefrontmatter property as described in: Non-Standard Template Extensions | Template Extensions other than .html | Functionality akin to resources.ExecuteAsTemplate and resources.FromString in Hugo - #11 by sirinath (components/content/src/front_matter/page.rs) - Handle the filename property when rendering (
components/site/src/lib.rs) - Describe the added frontmatter value in the docs (
docs/content/documentation/content/page.md)
Since the configuration value default would have the existing hardcoded value, it would not change the behavior of existing websites on upgrade. This change would also be unobtrusive and local (doesn’t affect other existing functionality), with a nice value-add, in my opinion.
I’ve published the following branch with the above changes:
Let me know what you think.
(PS: The pad posted by OP is no longer accessible.)