templates/section.html
35 lines · 1559 bytes
1{% extends "base.html" %}
2
3{% block title %}{{ page.title | lower }} · {{ site.title }}{% endblock %}
4{% block description %}{{ page.keywords.description | default(site.description) }}{% endblock %}
5
6{% block content %}
7<article class="prose">
8 <h1 class="page-label">{{ page.title }}</h1>
9 {{ body | safe }}
10</article>
11
12{#- Lists the pages one directory below this section index, by #+WEIGHT:. #}
13{% set section = page.source | replace("index.org", "") %}
14{% set plain = page.keywords.plain %}
15{% set entries = pages | selectattr("source", "startingwith", section) | rejectattr("source", "eq", page.source) | sort(attribute="keywords.weight") %}
16{% if entries %}
17<ul class="plainlist">
18 {% for page in entries %}
19 <li>
20 {% if page.keywords.app %}{% set icon_page = pages | selectattr("source", "eq", page.keywords.app) | first %}{% set icon_class = "app-icon app-icon-xs" %}{% include "partials/app-icon.html" %}{% endif %}
21 <span class="pl-main">
22 <a class="pl-name" href="/{{ page.url | replace("index.html", "") }}">{{ page.title }}</a>
23 {% if page.keywords.description %}<span class="pl-desc">{{ page.keywords.description }}</span>{% endif %}
24 </span>
25 {% if not plain %}
26 <span class="pl-links">
27 {% if page.keywords.appstore %}<a class="pl-link" href="{{ page.keywords.appstore }}">app store →</a>{% endif %}
28 {% if page.keywords.repo %}<a class="pl-link" href="{{ page.keywords.repo }}">source →</a>{% endif %}
29 </span>
30 {% endif %}
31 </li>
32 {% endfor %}
33</ul>
34{% endif %}
35{% endblock %}