Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow using all of Tera's features (macros, includes, etc.) #75

@TECHNOFAB11

Description

@TECHNOFAB11

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:

|- templates
|   |- <templatename>
|   |   |- flake.nix
|   |   |- template.toml
|- utils/shared/common whatever
|   |- flake.nix

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions