mirror of
https://github.com/Speyll/anemone.git
synced 2024-11-21 20:56:29 +00:00
fixed header_nav links to use get_url
This commit is contained in:
parent
63f83cebb7
commit
de633ec8f2
1 changed files with 146 additions and 150 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue