-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharing identical files between templates #67
Comments
|
I was writing that Jinja's inheritance mechanism doesn't work with files outside the templates folder, but I just remembered the one of Jinja's loader allows you to specify several folders as sources... So yes, in theory, we could use Jinja's ChoiceLoader or maybe a PrefixLoader by default and have a list of optional "extra templates folders" in the How it's sound to you? |
Thanks for your answer. You appear to a have much more knowledge about Jinja2's engine than me. My suggestion is that once we merge (or reject) the PR resulting from that you may release |
I wonder if we couldn't just:
We would need to define an order of precedence within that list and versus the original I am still researching whether using Jinja2's ChoiceLoader would offer any benefits. The documentation of the ChoiceLoader class reads:
|
I believe we were talking about different things. You: How to teach Jinja2 to locate additional files... We can already specify additional lookup paths via the Nevermind I have an elegant idea on how to address this. |
This is issue is no longer relevant. |
I share many identical files between different template folders.
I'd really like to keep my templates DRYer and include those files by reference only.
@jpscaletti
Do you get an idea of how we could achieve this?
Some ideas:
Relates to: #58
The text was updated successfully, but these errors were encountered: