Closed markokocic closed 3 years ago
Hi @markokocic thanks for opening an issue for this feature!
I think we have most of this figured out because of how template rendering already works; I think it would mostly only take changes to the syntax to accept a new keyword and to the compiler to spit out the code to render the included template. Sounds like a fun feature to work on as well! 😄
I'm working on it :)
Thanks to @guilhermecomum's work, we've landed the initial support for include
. I'll close this ticket, but please feel free to re-open it or open a new one if anything comes around, @markokocic.
Thank you! 🙇🏾
Basic include statement works for me.
Btw, is there a way to pass a parameter to the include statement? Something like
{% include "page.html", content=post %}
@markokocic nice! thanks for giving it a try 🙇🏾
hmm, that's an interesting feature. I've been eyeing Jinja's Macros design. I think it'd probably be more powerful than messing with the scope in an include system (that being said, I believe the current implementation of include should see the variables available for the template including it).
While trying to port my old website templates from
Cryogenweb
selmer
toweblorg
I found out thattemplatel
is missing ability toinclude
a template inside another template.I fish to do something like this:
This would allow for better template reusability.