From 12babae24ec6aa2375d13649a27e5ad2205afefe Mon Sep 17 00:00:00 2001 From: Jovan Gerodetti Date: Wed, 23 Oct 2024 15:12:54 +0200 Subject: [PATCH] Devlog article pages don't link to Atom feed --- website/templates/layout.html | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/website/templates/layout.html b/website/templates/layout.html index bec8dd74fc81..a3485e923c98 100644 --- a/website/templates/layout.html +++ b/website/templates/layout.html @@ -91,8 +91,22 @@ - {% if section and section.generate_feeds %} - + {%- set c_is_section_with_feed = (section and section.generate_feeds) -%} + + {% if page %} + {%- set c_parent_section = get_section(path=page.ancestors | last, metadata_only=true) -%} + {%- set c_is_page_in_feed = c_parent_section | get(key="generate_feeds") -%} + {% else %} + {%- set c_is_page_in_feed = false -%} + {% endif %} + + {% if c_is_section_with_feed or c_is_page_in_feed %} + {% if c_is_section_with_feed %} + {%- set c_feed_path = section.path -%} + {% else %} + {%- set c_feed_path = c_parent_section.path -%} + {% endif %} + {% endif %}