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 %} {% for nav_item in config.extra.header_nav %}
{% set current_nav_item = nav_item[lang] %} {% set current_nav_item = nav_item[lang] %}
{% if current_nav_item and current_nav_item.name %} {% 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 %} {% endif %}
{% endfor %} {% endfor %}
<div class="themeSwitch"> <div class="themeSwitch">
<button class="themeButton light" onclick="setTheme('light')" title="Light mode"></button> <button class="themeButton light" onclick="setTheme('light')" title="Light mode"></button>
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"></button> <button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode"></button>
</div> </div>
</nav> </nav>
{% endif %} {% endif %}
<script> <script>
const setTheme = (theme) => { const setTheme = (theme) => {
document.documentElement.className = theme; document.documentElement.className = theme;
@ -127,11 +125,9 @@
getTheme() getTheme()
</script> </script>
</header> </header>
<main> <main>
{% block content %}{% endblock content %} {% block content %}{% endblock content %}
</main> </main>
<footer> <footer>
{% block footer %}{% endblock footer %} {% block footer %}{% endblock footer %}
<hr> <hr>