webbed-site/templates/header.html
2024-07-07 21:28:54 -05:00

48 lines
1.9 KiB
HTML

{% set current_lang = config.default_language %}
{% if page %}
{% set current_lang = page.lang %}
{% elif section %}
{% set current_lang = section.lang %}
{% endif %}
<a href="/"><h1>peachmoon.moe</h1></a>
{% if config.extra.header_nav %}
<nav class="navBar">
{% if config.generate_feed %}
<a class="icons__background" target="_blank" rel="noopener noreferrer" href="{{ get_url(path="atom.xml", trailing_slash=false) }}" title="Subscribe via RSS for updates."><i class="ph ph-rss-simple"></i></a>
{% endif %}
{% 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 %}
<div class="themeSwitch">
{% if not config.extra.default_theme %}
<button class="themeButton light" onclick="setTheme('light')" title="Light mode">
<i class="ph ph-sun-dim"></i>
</button>
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode">
<i class="ph ph-moon-stars"></i>
</button>
{% elif config.extra.default_theme and config.extra.default_theme == "light" %}
<button class="themeButton light" onclick="setTheme('light')" title="Light mode">
<i class="ph ph-sun-dim"></i>
</button>
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode">
<i class="ph ph-moon-stars"></i>
</button>
{% elif config.extra.default_theme and config.extra.default_theme == "dark" %}
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode">
<i class="ph ph-sun-dim"></i>
</button>
<button class="themeButton light" onclick="setTheme('light')" title="Light mode">
<i class="ph ph-moon-stars"></i>
</button>
{% endif %}
</div>
</nav>
<div id="top"></div>
{% endif %}