From 63010fd88f9d1a5757160ab4db05d48df6f00f93 Mon Sep 17 00:00:00 2001 From: ledoyen Date: Sun, 11 Sep 2022 10:37:11 +0200 Subject: [PATCH] fix: remove hardcoded section for docs & blog --- templates/base.html | 6 ++++++ templates/blog/page.html | 2 -- templates/docs/page.html | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/base.html b/templates/base.html index c5a12d7..dc6212b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,6 +18,12 @@ {{ macros_head::resource() }} {{ macros_head::stylesheet() }} +{% if current_path -%} + {% set current_section = current_path | split(pat="/") | nth(n=1) -%} +{% else -%} + {% set current_section = '/' -%} +{% endif -%} + {% block seo %} {% if config.extra.title_separator %} {% set title_separator = " " ~ config.extra.title_separator ~ " " %} diff --git a/templates/blog/page.html b/templates/blog/page.html index ac334f9..1e106b9 100644 --- a/templates/blog/page.html +++ b/templates/blog/page.html @@ -3,8 +3,6 @@ {% extends "page.html" %} {% block seo %} - {# This value is matched by the config.extra.menu.main->section #} - {% set_global current_section = 'blog' %} {{ super() }} {% endblock seo %} diff --git a/templates/docs/page.html b/templates/docs/page.html index d215d83..c304803 100644 --- a/templates/docs/page.html +++ b/templates/docs/page.html @@ -5,8 +5,6 @@ {% endblock body %} {% block header %} - {# This value is matched by the config.extra.menu.main~url #} - {% set current_section = "docs" %} {{ macros_header::header(current_section=current_section)}} {% endblock header %}