From 675339d8d5c4f8dc4a93f48171e6777f47946282 Mon Sep 17 00:00:00 2001 From: Jake <j.vondoemming@stud.uni-goettingen.de> Date: Mon, 3 Oct 2022 00:26:26 +0200 Subject: [PATCH] use new 'page' syntax for homepage --- config.json | 2 +- fgs/generator.py | 4 ++-- theme/templates/macros/nav.html | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/config.json b/config.json index f0573ab..9a89bd2 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "relative_urls": true, - "homepage_slug": "index", + "homepage": { "page": "index" }, "theme": { "default_tag_color": "#000000", "static_dir": "theme", diff --git a/fgs/generator.py b/fgs/generator.py index 37b5f10..1531922 100644 --- a/fgs/generator.py +++ b/fgs/generator.py @@ -78,8 +78,8 @@ class Generator: def generate_homepage(self, writer, lang, path): - page = self.context['pages'][lang][self.config['homepage_slug']] - writer.write_template(page.template, path , lang, {'page': page}, page.config) + page = self.factories['config'].get(lang)['homepage']['page'] + writer.write_template(page.template, path , lang, {'page': page}, page.config) def generate_output(self, writer): diff --git a/theme/templates/macros/nav.html b/theme/templates/macros/nav.html index 0faa89d..f06e04e 100644 --- a/theme/templates/macros/nav.html +++ b/theme/templates/macros/nav.html @@ -17,9 +17,7 @@ {%- macro render_breadcrumb_menu(cat, lang, page = None) -%} <nav class="breadcrumb" {% if cat.color -%}style="--category-color: {{ cat.color }}"{%- endif -%}> <ul> - {%- call(homepage) get.page_by_slug(config.homepage_slug, lang) -%} - <li>{{ common.render_link(homepage.link, None, lang) }}</li> - {%- endcall -%} + <li>{{ common.render_link(config.homepage.page.link, None, lang) }}</li> <li>{{ common.render_link(cat.link, None, lang) }}</li> {%- if page -%} <li>{{ common.render_link(page.link, None, lang) }}</li> -- GitLab