2023-11-07 23:19:50 +00:00
|
|
|
{% set current_lang = config.default_language %}
|
|
|
|
{% if page %}
|
|
|
|
{% set current_lang = page.lang %}
|
|
|
|
{% elif section %}
|
|
|
|
{% set current_lang = section.lang %}
|
|
|
|
{% endif %}
|
2023-09-09 18:20:39 +01:00
|
|
|
{% if config.extra.header_nav %}
|
2023-11-07 23:19:50 +00:00
|
|
|
<nav class="navBar">
|
|
|
|
{% for nav_item in config.extra.header_nav %}
|
|
|
|
<a href="{{ nav_item.url }}" class="{% if nav_item.url == current_url %}active{% endif %}">
|
|
|
|
{% set language_key = 'name_' ~ current_lang %}
|
|
|
|
{{ nav_item[language_key] }}
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
2023-10-05 22:38:45 +01:00
|
|
|
|
2023-09-09 18:20:39 +01:00
|
|
|
<div class="themeSwitch">
|
2023-10-05 22:38:45 +01:00
|
|
|
{% if not config.extra.default_theme %}
|
|
|
|
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
|
|
|
|
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
|
|
|
|
|
|
|
|
{% elif config.extra.default_theme and config.extra.default_theme == "light" %}
|
|
|
|
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"> <use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
|
|
|
|
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
|
|
|
|
|
|
|
|
{% elif config.extra.default_theme and config.extra.default_theme == "dark" %}
|
|
|
|
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
|
|
|
|
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
|
2023-09-29 04:22:02 +01:00
|
|
|
{% endif %}
|
2023-09-09 18:20:39 +01:00
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
{% endif %}
|