Template Designer Documentation — Jinja Documentation (3.1.x) jinja.palletsprojects.com html code generated by my jinja templates generally look half garbage because of indents and whitespace all over the place. I just learned about these pesky Whitespace Control characters that can get rid of the whitespace added from templating. You can also strip whitespace in templates by hand. If you add a minus sign (-) to the start or end of a block (e.g. a For tag), a comment, or a variable expression, the whitespaces before or after that block will be removed:
Posts tagged: jinja
All posts with the tag "jinja"
4 posts
latest post 2023-12-27
Publishing rhythm
API — Jinja Documentation (3.1.x) jinja.palletsprojects.com 🤯 jinja comes with a loader to templates! Defihnitely need to look at this for, as is till one of the biggest hot spots.
I’ve definitely been missing out on setting up a proper jinja loader on a few projects, I need to lean on this a bit more. The path can be relative or absolute. Relative paths are relative to the current working directory.
Template Designer Documentation — Jinja Documentation (3.1.x) jinja.palletsprojects.com A feature of jinja that I just discovered is including sub templates. Here is an example from the docs. And inside of my thoughts project I used it to render posts. note that post_item. html automatically inherits the post variable.