💭 Template Designer Documentation — Jinja Documentation ======================================================= !https://jinja.palletsprojects.com/en/3.1.x/templates/#include Date: July 28, 2023 Template Designer Documentation — Jinja Documentation (3.1.x) jinja.palletsprojects.com [1] A feature of jinja that I just discovered is including sub templates. Here is an example from the docs. ``` html {% include 'header.html' %} Body goes here. {% include 'footer.html' %} ``` And inside of my thoughts project I used it to render posts. ``` html {% for post in posts.__root__ %} {% include 'post_item.html' %} {% endfor %} ``` > note that post_item.html automatically inherits the post variable. !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://jinja.palletsprojects.com/en/3.1.x/templates/#include [2]: /thoughts/ [3]: /tags/thoughts/