kasperhermansen-blog/templates/section.html

50 lines
1.3 KiB
HTML
Raw Permalink Normal View History

2023-04-02 16:42:13 +02:00
{% extends "base.html" %}
{% block extra_head %}
<link rel="canonical" href="{{ section.permalink | safe }}">
<meta property="og:url" content="{{ section.permalink | safe }}" />
{% endblock extra_head %}
2023-04-02 16:42:13 +02:00
{% block content %}
<div class="container mx-auto px-4 max-w-3xl py-8 space-y-4">
{% if section.ancestors | length > 0 %}
2023-04-03 02:49:17 +02:00
{{ prev_macros::section_back_link(section=section) }}
{% endif %}
2023-04-02 16:42:13 +02:00
{% if section.extra.section_path -%}
2023-04-03 02:49:17 +02:00
{% set section = get_section(path=section.extra.section_path) %}
{% endif -%}
<h1 class="title text-peach text-3xl">
{{ section.title }}
</h1>
2023-04-02 16:42:13 +02:00
<main>
{%- if paginator %}
2023-04-02 16:42:13 +02:00
{%- set show_pages = paginator.pages -%}
{% else %}
2023-04-02 16:42:13 +02:00
{%- set show_pages = section.pages -%}
{% endif -%}
2023-04-02 16:42:13 +02:00
{{ post_macros::list_posts(pages=show_pages) }}
</main>
{% if paginator %}
<ul class="pagination">
2023-04-02 16:42:13 +02:00
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous | safe }} class="page-link" aria-label="Previous"><span aria-hidden="true">
Prev</span></a>
</span>
2023-04-02 16:42:13 +02:00
{% endif %}
{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next | safe }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
2023-04-02 16:42:13 +02:00
{% endif %}
</ul>
{% endif %}
2023-04-02 16:42:13 +02:00
</div>
{% endblock content %}