prettier-plugin-jinja-template
Version:
Prettier plugin for formatting jinja templates.
50 lines (37 loc) • 873 B
HTML
{% extends "base.html" %}
{% block title %}Index{% endblock %}
{% block head %}
{{ super() }}
<style type="text/css">
.important {
color: #336699;
}
</style>
{% endblock %}
{{ title }}
{# content #}
{% set welcome_message = "Welcome to my awesome homepage." %}
{% block content %}
<h1>Index</h1>
<p class="important">{{ welcome_message }}</p>
{% endblock %}
<div></div>
{{ name }}
{% for user in users %}
<li>{{ user.username|e }}</li>
{% else %}
<li><em>no users found</em></li>
{% endfor %}
{% macro input(name, value='', type='text', size=20) %}
{{ my_variable|default('my_variable is not defined') }}
{% for city, items in users|groupby("city") %}
<li>
{{ city }}
<ul>
{% for user in items %}
<li>{{ user.name }}</li>
{% endfor %}
</ul>
</li>
{% endfor %}
{% endmacro %}