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
When having a single repo with multiple templates for example it would be cool to have access to all the advanced features of Tera, like macros, blocks, includes etc.
Currently everything is rendered using one_off, thus no includes etc. work.
It might be possible to just pass the root path of the repo to Tera, not sure what the performance implications are when the repo is quite big (if Tera loads these files no matter what it would be hell, but if they're only loaded on demand anyways it should be fine).
That way something like that would be possible:
And then be able to {% extend "utils/flake.nix" %} in templates/<name>/flake.nix. This way files and contents which are shared across templates could be pulled out to a single path, making maintenance easier :)
Repos containing just a single template could benefit from this aswell, as these features could still be used (the imported files just have to be added to ignore so they're just used by Tera)
The text was updated successfully, but these errors were encountered:
I'm not too sure about that, since it becomes tricky to see the difference between the template files and the files used just to generate the templates. I'll need to think about it
When having a single repo with multiple templates for example it would be cool to have access to all the advanced features of Tera, like macros, blocks, includes etc.
Currently everything is rendered using one_off, thus no includes etc. work.
It might be possible to just pass the root path of the repo to Tera, not sure what the performance implications are when the repo is quite big (if Tera loads these files no matter what it would be hell, but if they're only loaded on demand anyways it should be fine).
That way something like that would be possible:
And then be able to
{% extend "utils/flake.nix" %}
intemplates/<name>/flake.nix
. This way files and contents which are shared across templates could be pulled out to a single path, making maintenance easier :)Repos containing just a single template could benefit from this aswell, as these features could still be used (the imported files just have to be added to
ignore
so they're just used by Tera)The text was updated successfully, but these errors were encountered: