init dynamic sv/en toggle

This commit is contained in:
gws 2024-11-13 09:19:34 +01:00
parent cb3bacb7f5
commit be844107ea
3 changed files with 10 additions and 4 deletions

View file

@ -1,8 +1,8 @@
+++
title = "Contact"
description = "How to get in contact"
description = "Hello World"
weight = 10
template = "contact.html"
template = "page.html"
[extra]
disable_toc = true
+++

View file

@ -1,6 +1,6 @@
{% macro render_header(path) %}
{% set root = get_section(path="_index.md") %}
<a href="{{ root.permalink | safe }}">
<a href="{{ root.permalink | safe }}#top">
<div class="logo">
<img src="{{ get_url(path=config.extra.juice_logo_path) }}" alt="logo">
{{ config.extra.juice_logo_name }}
@ -34,7 +34,10 @@
{% if lang == "en"%}
<a class="nav-item subtitle-text" href="/sv{{ path }}"><img alt="swedish" class="flag"
src="/flag-for-sweden-svgrepo-com.svg"></a>
src="/flag-for-sweden-svgrepo-com.svg" _="on click set path to window.location.pathname js(path)
console.log(path.split('/'))
return path end
log(it)"></a>
{% else %}
<a class="nav-item subtitle-text" href="{{ path }}"><img alt="english" class="flag"
src="/flag-for-united-kingdom-svgrepo-com.svg"></a>

View file

@ -10,6 +10,9 @@
</header>
{% endblock header %}
{% block hero %}
{% endblock hero %}
{% block content %}
<div class="content text contact">