about summary refs log tree commit diff stats
path: root/templates/nav.html
blob: cd2d3912b5aa2616a5d7655d2329d2fa5c7a34f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% set current_lang = config.default_language %}
{% if page %}
  {% set current_lang = page.lang %}
{% elif section %}
  {% set current_lang = section.lang %}
{% endif %}
{%- if config.extra.main_menu %}
  {%- for item in config.extra.main_menu %}
    {% set language_key = 'name_' ~ current_lang %}
    {%- if item.url is matching("https?://") %}
      <a href="{{ item.url }}">{{ item[language_key] }}</a>
    {%- else %}
      <a href="{{ get_url(path=item.url, lang=lang )}}">{{ item[language_key] }}</a>
    {%- endif %}
  {%- endfor %}
{%- endif -%}