newblog/templates/categories/list.html
2024-07-01 13:20:09 +00:00

36 lines
1.3 KiB
HTML

{% extends "base.html" %}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %}
{%- block seo %}
{{- super() }}
{%- set title = "Categories" %}
{%- if config.title %}
{%- set title_addition = title_separator ~ config.title %}
{%- else %}
{%- set title_addition = "" %}
{%- endif %}
{%- set description = config.description %}
{{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
{%- endblock seo %}
{%- block content %}
<div>
<div class="c">
<h1>{{ terms | length }} {{ macros::translate(key="Categories", default="Categories", i18n=i18n) }} </h1>
<p>{% for term in terms %} [<a href="#{{ term.name }}">{{ term.name }}</a>]<sup>{{ term.pages | length }}</sup> {% endfor %}</p>
</div>
{%- for term in terms %}
<h2 id="{{ term.name }}"><a href="{{ term.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ term.name }}</a></h2>
{%- for page in term.pages %}
<p><a href="{{ page.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format="%F") }}</time></p>
{%- endfor %}
{%- endfor %}
</div>
{%- endblock content %}