Skip to content

Commit 151877e

Browse files
author
Nate Smith
committed
Merge pull request MissingMaps#154 from MissingMaps/fix/lang-switch
Fix/lang switch
2 parents 46060cb + 2f84f3e commit 151877e

11 files changed

Lines changed: 24 additions & 7 deletions

File tree

app/_includes/header.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525
|
2626
<li class="nav-item nav-dropdown">{{locale}}
2727
<div class="dropdown-content">
28-
{% for loc in site.authorized_locales %} {% if loc == site.default_locale %}
29-
<a href="/">
28+
{% for loc in site.authorized_locales %}
29+
{% assign pg = site.pages | where:"lang",{{loc}} | where:"id",page.id | first %}
30+
<a href="{{site.baseurl}}{{pg.url}}">
3031
<div class="nav-item item-centered">{{loc}}</div>
3132
</a>
32-
{% else %}
33-
<a href="{{site.baseurl}}/{{loc}}/">
34-
<div class="nav-item item-centered">{{loc}}</div>
35-
</a>
36-
{% endif %} {% endfor %}
33+
{% endfor %}
3734
</div>
3835
</li>
3936
</ul>

app/en/about.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /about/
4+
id: about
5+
lang: en
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/en/contribute.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /contribute/
4+
id: contribute
5+
lang: en
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/en/events.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /events/
4+
id: events
5+
lang: en
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/en/host.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /host/
4+
id: host
5+
lang: en
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/en/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /
4+
id: index
5+
lang: en
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/fr/about.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /fr/apropos/
4+
id: about
5+
lang: fr
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/fr/contribute.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /fr/contribuer/
4+
id: contribute
5+
lang: fr
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/fr/events.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /fr/evenements/
4+
id: events
5+
lang: fr
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

app/fr/host.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
layout: default
33
permalink: /fr/organiser/
4+
id: host
5+
lang: fr
46
---
57
{% include get_locale.html %}
68
{% include header.html %}

0 commit comments

Comments
 (0)