blog/themes/retro-future/templates/section.html
2025-12-12 15:30:04 +11:00

37 lines
1.1 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ section.title }} · {{ config.title }}{% endblock title %}
{% block content %}
<h1 class="page-title">{{ section.title }}</h1>
{% if section.content %}
<div class="section-content">
{{ section.content | safe }}
</div>
{% endif %}
{% if section.pages %}
<ul class="post-list">
{% for page in section.pages %}
<li class="post-list__item">
<h2 class="post-list__title">
<a href="{{ page.permalink }}">{{ page.title }}</a>
</h2>
{% set path_parts = page.relative_path | split(pat="/") %}
{% if path_parts | length > 2 %}
{% set parent_dir = path_parts | slice(end=-2) | join(sep="/") %}
{% set parent_section = get_section(path=parent_dir ~ "/_index.md") %}
{% if parent_section and parent_section.extra.series %}
<p class="post-list__series">Part of the series: <a href="{{ parent_section.permalink }}">{{ parent_section.title }}</a></p>
{% endif %}
{% endif %}
{% if page.description %}
<p class="post-list__description">{{ page.description }}</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock content %}