diff --git a/theme/templates/base.html b/theme/templates/base.html index 11e95161be495c6cf108971409aaa21c5835ee30..368609b9cc0f677ace32062c4f514173598f43e7 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>