From a1672fbfbe1929e6b425eb62a4eb680de919ed7e Mon Sep 17 00:00:00 2001
From: Jake <j.vondoemming@stud.uni-goettingen.de>
Date: Tue, 2 Aug 2022 11:08:39 +0200
Subject: [PATCH] readded menu items

---
 theme/templates/base.html | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/theme/templates/base.html b/theme/templates/base.html
index 11e9516..368609b 100644
--- a/theme/templates/base.html
+++ b/theme/templates/base.html
@@ -1,4 +1,9 @@
 <!DOCTYPE html>
+
+{%- import 'macros/getters.html' as get with context -%}
+{#{%- import 'macros/cards.html' as cards with context -%}
+{%- import 'macros/renderers.html' as render with context -%}#}
+
 <html lang="{%- block html_lang -%}{{ l }}{%- endblock html_lang -%}">
 <head>
 	{% block head %}
@@ -35,16 +40,14 @@
 		<nav>
 			<ul>
 			{% for item in config.menuitems -%}
-			{{item}}
-				{#
 				{%- if item.tag is defined -%}
-					{%- call(nativetag, sccat, _) get.tag_by_name(item.tag) -%}
-						<li style="--category-color: {{ sccat.color }}"><a href="{{ siteurl }}/{{ nativetag.url }}">{{ sccat[lang]|e }}</a></li>
+					{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(item.tag, l) -%}
+						<li style="--category-color: {{ tagcolor }}"><a href="{{ siteurl }}/{{ tagurl }}">{{ tagtitle|e }}</a></li>
 					{%- endcall -%}
 				{%- elif item.slug is defined -%}
-					{%- call(aop, _) get.article_or_page_by_slug(item.slug, lang) -%}
-					{%- call(__, sccat, ___) get.category_by_name(aop.category.name, True) -%}
-						<li style="--category-color: {{ sccat.color }}"><a href="{{ siteurl }}/{{ aop.url }}">{{ aop.title }}</a></li>
+					{%- call(page) get.page_by_slug(item.slug, l) -%}
+					{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(page.category, l) -%}
+						<li style="--category-color: {{ tagcolor }}"><a href="{{ siteurl }}/{{ page.url }}">{{ page.title|e }}</a></li>
 					{%- endcall -%}
 					{%- endcall -%}
 				{%- else -%}
@@ -52,7 +55,6 @@
 					<strong>ERROR: menuitems: Cannot parse item: {{ item|string|e }}</strong><br />
 					<br />
 				{%- endif -%}
-				#}
 				{#- TODO add active class if this is the current site -#}
 			{%- endfor %}
 			</ul>
-- 
GitLab