From 790cea61807740bd2f58218a1001b0fde72a9928 Mon Sep 17 00:00:00 2001 From: Julia Luna Date: Sun, 3 Jul 2022 18:31:45 +0200 Subject: [PATCH] actually make index usable --- templates/index.html | 70 +++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/templates/index.html b/templates/index.html index f976ef6..f0fd607 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,31 +1,59 @@ {% 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") }}{% if page.extra.author %}, by {{ page.extra.author }}{% endif %} + {% 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 %} + {{ config.extra.index_nav_text | default(value="") }} + +{% endblock nav %} + {% block footer %} - - © {{ now() | date(format='%Y') }} - {% if section.extra.author %} - {{ section.extra.author }} - {% elif config.extra.author %} - {{ config.extra.author }} - {% endif %} - + + © {{ now() | date(format='%Y') }} + {% if section.extra.author %} + {{ section.extra.author }} + {% elif config.extra.author %} + {{ config.extra.author }} + {% endif %} + {% 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=1) }} + {% endif %} {% endblock %} \ No newline at end of file