fixed header_nav links to use get_url

This commit is contained in:
Speyll 2023-09-06 11:08:00 +01:00
parent 63f83cebb7
commit de633ec8f2

View file

@ -104,17 +104,15 @@
{% for nav_item in config.extra.header_nav %}
{% set current_nav_item = nav_item[lang] %}
{% if current_nav_item and current_nav_item.name %}
<a href="{{ current_nav_item.url | safe }}" {% if current_nav_item.new_tab %}target="_blank" rel="noreferrer noopener"{% endif %}>{{ current_nav_item.name }}</a>
<a href="{{ get_url(path=current_nav_item.url) }}" {% if current_nav_item.new_tab %}target="_blank" rel="noreferrer noopener"{% endif %}>{{ current_nav_item.name }}</a>
{% endif %}
{% endfor %}
<div class="themeSwitch">
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"></button>
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"></button>
</div>
</nav>
{% endif %}
<script>
const setTheme = (theme) => {
document.documentElement.className = theme;
@ -127,11 +125,9 @@
getTheme()
</script>
</header>
<main>
{% block content %}{% endblock content %}
</main>
<footer>
{% block footer %}{% endblock footer %}
<hr>