rf-web/_includes/common/navigation.html
2022-05-30 10:48:34 +02:00

45 lines
2.5 KiB
HTML

{% if page.menu-variant %}
{% assign menu = site.data.menu-variants[page.menu-variant] %}
{% elsif include.menu %}
{% assign menu = include.menu %}
{% else %}
{% assign menu = site.data.menu-variants.main %}
{% endif %}
<nav class="menu page-content">
{% if include.clock or page.with-clock %}
{% include common/clock.html %}
{% endif %}
{% for item in menu %}
{% if item.items %}
<div class="nav-group" tabindex="0">
<a href="{% if item[page.lang].to %}{{- item[page.lang].to -}}{% elsif item[page.lang].url %}{{- item[page.lang].url | default: '#' -}}{% endif %}" class="nav-link colour-{{ item[page.lang].colour | default: 'black' }} {{ item.case }}">{{ item[page.lang].name }}</a>
{% if item.items %}
<div class="sub-nav-group">
{% for sublink in item.items %}
{% if page.lang == 'en' %}
<a class="sub-nav-link colour-{{ sublink[page.lang].colour | default: 'black' }} {{ sublink.case }}" href="{% if sublink[page.lang].to %}{{- sublink[page.lang].to -}}{% elsif sublink[page.lang].url %}{{- sublink[page.lang].url -}}{% endif %}">{{ sublink[page.lang].name }}</a>
{% else %}
<a class="sub-nav-link colour-{{ sublink[page.lang].colour | default: 'black' }} {{ sublink.case }}" href="{% if sublink[page.lang].to %}/{{- page.lang | append: sublink[page.lang].to -}}{% elsif sublink[page.lang].url %} {{- sublink[page.lang].url -}}{% endif %}">{{ sublink[page.lang].name }}</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
{% else %}
{% if page.lang == 'en' %}
<div class="nav-group">
<a class="nav-link colour-{{ item[page.lang].colour | default: 'black' }} {{ item.case }}" href="{% if item[page.lang].to %}{{- item[page.lang].to -}}{% elsif item[page.lang].url %}{{- item[page.lang].url | default: '#' -}}{% endif %}">{{ item[page.lang].name }}</a>
</div>
{% else %}
<div class="nav-group">
<a class="nav-link colour-{{ item[page.lang].colour | default: 'black' }} {{ item.case }}" href="{% if item[page.lang].to %}/{{- page.lang | append: item[page.lang].to -}}{% elsif item[page.lang].url %}{{- item[page.lang].url | default: '#' -}}{% endif %}">{{ item[page.lang].name }}</a>
</div>
{% endif %}
{% endif %}
{% endfor %}
{% include common/lang-selector.html en-text="/english" fr-text="/français" %}
</nav>