Open ModProg opened 1 year ago
I don't know cargo-hatch but the way I handle it in https://github.com/Keats/kickstart is to have a way to ignore files from the generation. Now it depends whether you have values you do want to change in those file: that's more complex in that case. Just trying to give another idea as that's not going to happen in Tera itself for a long time
Now it depends whether you have values you do want to change in those file: that's more complex in that case.
well thats exactly what I try to do :(, but maybe I can hack something together by doing some search and replace before calling tera
You can wrap things in {% raw %} {% endraw %}
for the things that shouldn't be replaced
You can wrap things in {% raw %} {% endraw %} for the things that shouldn't be replaced
Maybe that is the quickest thing to set up. thanks
Thank you for helping out on this @Keats!
Looks like {% raw %} {% endraw %}
is the best way to go. @ModProg I'll leave the issue open, and just let me know if there's anything I can help with to get it working for you 👍 (or close it, if that solved the problem).
The only thing that might be interesting is the "ignore for templating".
But until this is resolved in tera which might be a while there is no need to implement custom delimiters here :)
True, currently there is only the .hatchignore
, which skips the file altogether, not even copying it over.
As it turns out, I actually used the {% raw %}
myself already in one of my own templates, that I just didn't use for a long time. There I have askama
HTML templates, which happen to use the same syntax, so I mixed it with that special attribute here and there.
As it turns out, I actually used the
{% raw %}
myself already in one of my own templates, that I just didn't use for a long time. There I haveaskama
HTML templates, which happen to use the same syntax, so I mixed it with that special attribute here and there.
Maybe we should add it to the documentation, as for these templates you seldom need the full feature set from tera, but raw is quite useful.
I have a file using terra like templates inside a template.
So having the ability to change the delimter to some other character would be great.
Related tera issue: https://github.com/Keats/tera/issues/343