website/_includes/menu.html
Valentin Gehrke 17d5e8ebe0 Add menu order feature
Menu items are now sorted by the menuorder attribute of their page.
As we have a page for each language, this attribute has to be set for both of
them.
The default value is 100. pages with equal value are sorted by name.
The index pages are set 0.
2018-06-19 16:58:18 +02:00

12 lines
517 B
HTML

{% assign sorted_nodes = site.pages | sort:"menutitle" | sort:"menuorder" %}
{%- for node in sorted_nodes -%}
{%- if node.lang == page.lang and node.menutitle -%}
{%- if node.url == page.url -%}
<li><a href="{{ node.url }}" class="is-active">{{ node.menutitle | escape }}</a></li>
{%- else -%}
<li><a href="{{ node.url }}">{{ node.menutitle | escape }}</a></li>
{%- endif -%}
{%- endif -%}
{%- endfor -%}
<li><a href="https://git.zom.bi/explore/projects">Git</a></li>
<li><a href="https://wiki.zom.bi/">Wiki</a></li>