rf-web/_includes/common/lang-selector.html
Benjamin Jones 245112c463 updated menu
2020-08-16 11:52:49 +02:00

40 lines
1.5 KiB
HTML

{% assign posts=site.posts | where:"ref", page.ref | sort: 'lang' %}
{% assign newpages=site.pages | where:"ref", page.ref | sort: 'lang' %}
<div class="nav-group">
{% if posts.size > 1 %}
{% for post in posts %}
{% if post.lang != page.lang %}
<a href="{{ site.base-url }}{{ post.url }}" class="lang lang--{{ page.lang }}">
{% if page.lang == 'en' %}
{{ include.fr-text }}
{% else %}
{{ include.en-text }}
{% endif %}
</a>
{% endif %}
{% endfor %}
{% elsif newpages.size > 1 %}
{% for pege in newpages %}
{% if pege.lang != page.lang and page.ref != '' %}
{% if page.lang == 'en' %}
<a href="{{ pege.url }}" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
{% else %}
<a href="{{ pege.url }}" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
{% endif %}
{% endif %}
{% endfor %}
{% elsif page.lang == 'en' %}
<a href="{{ site.baseurl }}/fr" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
<span class="poop">{{ site.data.menu[page.ref]}}</span>
{% else %}
<a href="{{ site.baseurl }}/" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
<span class="poop">{{ site.data.menu[page.ref]}}</span>
{% endif %}
</div>