Skip to content

Commit 94c246a

Browse files
committed
Clarify variable name in lang switcher
1 parent 8486764 commit 94c246a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

_includes/header.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
{% assign langmenu = false %}
2222
{% endif %}
2323
{% if langmenu %}
24-
{% assign posts = site.pages | concat: site.doc | concat: site.translated | where:'ref', page.ref | sort: 'lang' %}
24+
<!-- find this page in other languages -->
25+
{% assign page_all_langs = site.pages | concat: site.doc | concat: site.translated | where:'ref', page.ref | sort: 'lang' %}
2526
<div class="langdropdown langdropdown-sm">
2627
<label class="langdropbtn-sm" for="langdropdown-toggle-sm"><img src="/attachment/icons/icons8-translation-64.png" width="24" height="24"></label>
2728
<input type="checkbox" id="langdropdown-toggle-sm">
2829
<div class="langdropdown-content" id="langdropdown-dd-sm">
29-
{% for post in posts %}
30-
{% if site.languages contains post.lang %}
31-
<a class="c1" href="{{ post.url }}">{{ post.lang }}</a>
30+
{% for translated in page_all_langs %}
31+
{% if site.languages contains translated.lang %}
32+
<a class="c1" href="{{ translated.url }}">{{ translated.lang }}</a>
3233
{% endif %}
3334
{% endfor %}
3435
</div>
@@ -57,8 +58,8 @@
5758
<label class="langdropbtn-lg" for="langdropdown-toggle-lg"><img src="/attachment/icons/icons8-translation-64.png" width="24" height="24"></label>
5859
<input type="checkbox" id="langdropdown-toggle-lg">
5960
<div class="langdropdown-content" id="langdropdown-dd-lg">
60-
{% for post in posts %}
61-
<a class="c1" href="{{ post.url }}">{{ post.lang }}</a>
61+
{% for translated in page_all_langs %}
62+
<a class="c1" href="{{ translated.url }}">{{ translated.lang }}</a>
6263
{% endfor %}
6364
</div>
6465
</div>

0 commit comments

Comments
 (0)