better lang switcher

This commit is contained in:
Gaspard Jankowiak 2020-10-28 09:23:50 +01:00
parent 0909bb64ff
commit f2a622bb3a

View file

@ -48,16 +48,16 @@
<section>
{% if page.lang == 'en' %}
{% if page.fr_url == '' %}
<p class="switcher"><a href="{{ page.url | remove_first: '/en' }}">FR</a>|EN</p>
<p class="switcher"><a href="{{ page.url | remove_first: '/en' }}">🇫🇷</a></p>
{% else %}
<p class="switcher"><a href="{{ page.fr_url }}">FR</a>|EN</p>
<p class="switcher"><a href="{{ page.fr_url }}">🇫🇷</a></p>
{% endif %}
{% include nav_en.html %}
{% else %}
{% if page.en_url == '' %}
<p class="switcher">FR|<a href="/en{{page.url}}">EN</a></p>
<p class="switcher"><a href="/en{{page.url}}">🇬🇧</a></p>
{% else %}
<p class="switcher">FR|<a href="{{ page.en_url }}">EN</a></p>
<p class="switcher"><a href="{{ page.en_url }}">🇬🇧</a></p>
{% endif %}
{% include nav_fr.html %}
{% endif %}