From 50311dd9802e72d463a5cc12239e5d7a4650a195 Mon Sep 17 00:00:00 2001 From: xenua Date: Sun, 3 Jul 2022 18:32:03 +0200 Subject: [PATCH] actually make section useable --- templates/section.html | 56 ++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/templates/section.html b/templates/section.html index f976ef6..2d0cd5c 100644 --- a/templates/section.html +++ b/templates/section.html @@ -1,16 +1,29 @@ {% extends "base.html" %} +{% import "macros.html" as macros %} + {% block content %} -{% for page in section.pages | reverse %} -

{{ page.title }}

-{% if page.date %} -{{ page.date | date(format="%Y-%m-%d") }} -{% endif %} -{% if page.summary %} -

{{ page.summary | safe }}

-{% endif %} -{% if not loop.last %}
{% endif %} -{% endfor %} + {% for page in section.pages | reverse %} +

{{ page.title }}

+ {% if page.date %} + {{ page.date | date(format="%Y-%m-%d") }} + {% endif %} + {% if page.summary %} + {% if config.extra.summary_max_length %} + {% set sum = page.summary | safe | truncate(length=config.extra.summary_max_length) %} + {% else %} + {% set sum = page.summary | safe %} + {% endif %} +

{{ sum | safe }}

+ {% endif %} + {% if not loop.last %}
{% endif %} + {% endfor %} +{% endblock %} + +{% block nav %} + {% set dom = section.relative_path | trim_end_matches(pat="/_index.md") %} + ../{{ dom }} + {% endblock %} {% block footer %} @@ -25,7 +38,24 @@ {% endblock %} {% block aside %} -{% for k, thing in section %} -{{ k }}: {{ thing }}
-{% endfor %} + {% if section.title %} +

{{ section.title }}

+ {% endif %} + {% if section.content %} + {{ section.content | safe }} + {% endif %} + {% if section.subsections %} + {{ config.extra.subsections_string | default(value="Subsections:") }} + + {% endif %} + + {% if config.extra.xscratch_debug_info %} + Debug info: + {{ macros::debug(thing=section, label="section", recurse=2) }} + {% endif %} {% endblock %} \ No newline at end of file