2020-04-25 08:49:47 +00:00
|
|
|
{% assign posts=site.posts | where:"ref", page.ref | sort: 'lang' %}
|
2020-08-17 20:11:19 +00:00
|
|
|
{% assign pages=site.pages | where:"ref", page.ref | sort: 'lang' %}
|
2020-04-25 08:49:47 +00:00
|
|
|
|
2020-08-17 20:11:19 +00:00
|
|
|
<div class="nav-group lang-selector">
|
2020-08-16 09:52:49 +00:00
|
|
|
{% 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 %}
|
2020-04-25 08:49:47 +00:00
|
|
|
|
2020-08-17 20:11:19 +00:00
|
|
|
{% elsif pages.size > 1 %}
|
|
|
|
{% for newpage in pages %}
|
|
|
|
{% if newpage.lang != page.lang and page.ref != '' %}
|
2020-08-16 09:52:49 +00:00
|
|
|
{% if page.lang == 'en' %}
|
2020-08-17 20:11:19 +00:00
|
|
|
<a href="{{ newpage.url }}" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
|
2020-08-16 09:52:49 +00:00
|
|
|
{% else %}
|
2020-08-17 20:11:19 +00:00
|
|
|
<a href="{{ newpage.url }}" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
|
2020-08-16 09:52:49 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2020-04-25 08:49:47 +00:00
|
|
|
|
|
|
|
|
2020-08-16 09:52:49 +00:00
|
|
|
{% elsif page.lang == 'en' %}
|
2022-05-31 13:25:23 +00:00
|
|
|
<a href="/fr" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
|
2020-08-16 09:52:49 +00:00
|
|
|
{% else %}
|
2022-05-31 13:25:23 +00:00
|
|
|
<a href="/" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
|
2020-08-16 09:52:49 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-04-25 08:49:47 +00:00
|
|
|
|
|
|
|
|