krz/krz.sh

clone: git clone https://gitbay.org/krz/krz.sh.git

fc25583836ac3f62300328807b53257c13be01a0

verified · cmc

author: Christian Cleberg <hello@cleberg.net> · 2026-08-12T05:12:48Z

fix build: derive parent section from page.ancestors

page templates never receive a `section` variable, and tera raises on
the undefined name before `default()` can apply, so every page failed
to render. use get_section on the last ancestor instead. privacy pages
now link back to /privacy/ rather than the homepage.
 templates/page.html | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/templates/page.html b/templates/page.html
index 0682a66..7bf1800 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -4,7 +4,8 @@
 {% block description %}{{ page.description | default(value=config.description) }}{% endblock description %}
 
 {% block content %}
-<p class="back"><a href="{{ section.permalink | default(value=get_url(path="/")) | safe }}">&larr; back</a></p>
+{% set parent = get_section(path=page.ancestors | last, metadata_only=true) %}
+<p class="back"><a href="{{ parent.permalink | safe }}">&larr; back</a></p>
 <article class="prose">
   <h1 class="page-label">{{ page.title }}</h1>
   {% if page.description %}<p class="lede">{{ page.description }}</p>{% endif %}