friendenstein/templates/header.html

29 lines
2.1 KiB
HTML
Raw Normal View History

{% set current_lang = config.default_language %}
{% if page %}
2023-12-26 01:11:47 +01:00
{% set current_lang = page.lang %}
{% elif section %}
2023-12-26 01:11:47 +01:00
{% set current_lang = section.lang %}
{% endif %}
{% if config.extra.header_nav %}
2024-01-02 02:31:44 +01:00
<nav class="navbar">
2023-12-26 01:11:47 +01:00
{% include "logo.html" %}
2024-01-02 02:31:44 +01:00
<div class="theme-button">
2023-12-26 01:11:47 +01:00
{% if not config.extra.default_theme %}
2024-01-02 02:31:44 +01:00
<button class="theme-button 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="theme-button 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>
2023-12-26 01:11:47 +01:00
{% elif config.extra.default_theme and config.extra.default_theme == "light" %}
2024-01-02 02:31:44 +01:00
<button class="theme-button 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="theme-button 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>
2023-12-26 01:11:47 +01:00
{% elif config.extra.default_theme and config.extra.default_theme == "dark" %}
2024-01-02 02:31:44 +01:00
<button class="theme-button 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="theme-button 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-12-26 01:11:47 +01:00
{% endif %}
</div>
2024-01-02 02:31:44 +01:00
<div class="navbar-right">
2023-12-26 01:11:47 +01:00
{% for nav_item in config.extra.header_nav %}
<a href="{{ nav_item.url }}" class="{% if current_url and nav_item.url == current_url %}active{% endif %}">{% set language_key = 'name_' ~ current_lang %}{{ nav_item[language_key] }}</a>
{% endfor %}
</div>
</nav>
{% endif %}