---
title: "💭 Template Designer Documentation — Jinja Documentation"
description: "!https://jinja.palletsprojects.com/en/3.0.x/templates/#whitespace-control"
date: 2023-12-26
published: true
tags:
  - webdev
  - jinja
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://jinja.palletsprojects.com/en/3.0.x/templates/#whitespace-control" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-content">
      <div class="embed-card-title">Template Designer Documentation — Jinja Documentation (3.1.x)</div>
      <div class="embed-card-meta">jinja.palletsprojects.com</div>
    </div>
  </a>
</div>


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:

``` html
{% for item in seq -%}
    {{ item }}
{%- endfor %}
```

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
