display subsections in index.html

this adds all subsections and their contents to index.html; it also
disables pagination, since that doesn't seem to work too nicely
with anything more than just a single flat list …

Note that this only goes one level deep — if we ever have subsections of
subsections these currently won't show up in the main index.html.
main
stuebinm 2022-01-06 16:52:13 +01:00
parent 2d7192ba07
commit ff406a7741
2 changed files with 16 additions and 8 deletions

View File

@ -1,8 +1,7 @@
+++
title = "hacc infra documentation"
page_template = "doc-page.html"
sort_by = "title"
paginate_by = 10
#insert_anchor_links = "left"
sort_by="title"
+++

View File

@ -1,14 +1,23 @@
{% extends "base.html" %}
{% import "post_macros.html" as post_macros %}
{% block content %}
<main>
<!-- {{ post_macros::paginator_nav(paginator=paginator) }} -->
{% for page in paginator.pages %}
{% for page in section.pages %}
<p>
<h2><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h2>
<h3><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h3>
</p>
{% endfor %}
{{ post_macros::paginator_nav(paginator=paginator) }}
{% for sub in section.subsections %}
{% set subsection = get_section(path=sub) %}
<p>
<h2><a href="{{ subsection.permalink | safe }}">{{ subsection.title }}</a></h2>
{% for page in subsection.pages %}
<p>
<h3 style="margin-left:1em"><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h3>
</p>
{% endfor %}
</p>
{% endfor %}
</main>
{% endblock content %}