blog/templates/section.html
2026-02-09 12:30:49 +01:00

51 lines
1.9 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ section.title }} - {{ config.title }}{% endblock title %}
{% block description %}{% if section.description %}{{ section.description }}{% else %}{{ config.description }}{% endif %}{% endblock description %}
{% block canonical %}{{ section.permalink }}{% endblock canonical %}
{% block og_title %}{{ section.title }} - {{ config.title }}{% endblock og_title %}
{% block og_description %}{% if section.description %}{{ section.description }}{% else %}{{ config.description }}{% endif %}{% endblock og_description %}
{% block og_url %}{{ section.permalink }}{% endblock og_url %}
{% block twitter_title %}{{ section.title }} - {{ config.title }}{% endblock twitter_title %}
{% block twitter_description %}{% if section.description %}{{ section.description }}{% else %}{{ config.description }}{% endif %}{% endblock twitter_description %}
{% block content %}
<h1>{{ section.title }}</h1>
{% if section.content %}
<div class="section-content">
{{ section.content | safe }}
</div>
{% endif %}
<ul class="post-list">
{% if paginator %}
{% set pages = paginator.pages %}
{% else %}
{% set pages = section.pages %}
{% endif %}
{% for page in pages %}
<li>
{% if section.extra.display_chapter %}
<span class="chapter">{{ page.extra.chapter }}</span>
{% else %}
<time datetime="{{ page.date }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
{% endif %}
<a href="{{ page.permalink }}">{{ page.title }}</a>
</li>
{% endfor %}
</ul>
{% if paginator %}
<nav class="pagination">
{% if paginator.previous %}
<a href="{{ paginator.previous }}">&larr; {% if section.extra.display_chapter %}Previous{% else %}Newer{% endif %}</a>
{% endif %}
{% if paginator.next %}
<a href="{{ paginator.next }}">{% if section.extra.display_chapter %}Next{% else %}Older{% endif %} &rarr;</a>
{% endif %}
</nav>
{% endif %}
{% endblock content %}