Skip to content

Commit

Permalink
Clarify variable name in lang switcher
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Jun 24, 2021
1 parent df67360 commit 6e0c37a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
{% assign langmenu = false %}
{% endif %}
{% if langmenu %}
{% assign posts = site.pages | concat: site.doc | concat: site.translated | where:'ref', page.ref | sort: 'lang' %}
<!-- find this page in other languages -->
{% assign page_all_langs = site.pages | concat: site.doc | concat: site.translated | where:'ref', page.ref | sort: 'lang' %}
<div class="langdropdown langdropdown-sm">
<label class="langdropbtn-sm" for="langdropdown-toggle-sm"><img src="/attachment/icons/icons8-translation-64.png" width="24" height="24"></label>
<input type="checkbox" id="langdropdown-toggle-sm">
<div class="langdropdown-content" id="langdropdown-dd-sm">
{% for post in posts %}
{% if site.languages contains post.lang %}
<a class="c1" href="{{ post.url }}">{{ post.lang }}</a>
{% for translated in page_all_langs %}
{% if site.languages contains translated.lang %}
<a class="c1" href="{{ translated.url }}">{{ translated.lang }}</a>
{% endif %}
{% endfor %}
</div>
Expand Down Expand Up @@ -57,8 +58,8 @@
<label class="langdropbtn-lg" for="langdropdown-toggle-lg"><img src="/attachment/icons/icons8-translation-64.png" width="24" height="24"></label>
<input type="checkbox" id="langdropdown-toggle-lg">
<div class="langdropdown-content" id="langdropdown-dd-lg">
{% for post in posts %}
<a class="c1" href="{{ post.url }}">{{ post.lang }}</a>
{% for translated in page_all_langs %}
<a class="c1" href="{{ translated.url }}">{{ translated.lang }}</a>
{% endfor %}
</div>
</div>
Expand Down

0 comments on commit 6e0c37a

Please sign in to comment.