How Jinja2 Fragments works
mainJinja2 Fragments follows the principle of Locality of Behavior by allowing you to maintain a single template file for both full page and partial rendering.
Instead of splitting blocks into separate files and using include tags, you define all blocks in one template file. You can then choose to render the full template or render specific blocks independently. This is particularly useful for libraries like htmx that require fetching partial HTML content.