From ff406a77417f45e2761a49d26b65f4826613217c Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 6 Jan 2022 16:52:13 +0100 Subject: [PATCH] display subsections in index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- content/_index.md | 5 ++--- templates/index.html | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/content/_index.md b/content/_index.md index 30d1d3a..9cf3041 100644 --- a/content/_index.md +++ b/content/_index.md @@ -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" +++ diff --git a/templates/index.html b/templates/index.html index 22b89a0..8fae414 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,14 +1,23 @@ {% extends "base.html" %} -{% import "post_macros.html" as post_macros %} {% block content %}
- - {% for page in paginator.pages %} + {% for page in section.pages %}

-

{{ page.title }}

+

{{ page.title }}

{% endfor %} - {{ post_macros::paginator_nav(paginator=paginator) }} + + {% for sub in section.subsections %} + {% set subsection = get_section(path=sub) %} +

+

{{ subsection.title }}

+ {% for page in subsection.pages %} +

+

{{ page.title }}

+

+ {% endfor %} +

+ {% endfor %}
{% endblock content %}