Files
lektor-groupby-plugin/examples/templates/page.html
2022-04-06 13:16:44 +02:00

30 lines
811 B
HTML

<!doctype html>
<meta charset="utf-8">
<title>{% block title %}Welcome{% endblock %}</title>
<style type="text/css">
header, footer { padding: 1em; background: #DDD; }
main { margin: 3em; }
</style>
<body>
<header>
<div>Nav: &nbsp;
<a href="{{ '/'|url }}">Root</a> &nbsp;
<a href="{{ '/blog'|url }}">Blog</a> &nbsp;
<a href="{{ '/projects'|url }}">Projects</a>
</div>
</header>
<main>
<h2>{{ this.title }}</h2>
{% block body %}{{ this.body }}{% endblock %}
</main>
<footer>
{%- for k, v in [('testA','Config'),('testB','Simple'),('testC','Advanced')] %}
<div>{{v}} Tags:
{%- for x in this|groupby(k, recursive=True)|list|unique|sort %}
<a href="{{ x|url }}">({{x.key}})</a>
{%- endfor %}
</div>
{%- endfor %}
</footer>
</body>