Skip to content

Commit 68aa87b

Browse files
committed
pull localization code into include
1 parent eab56c7 commit 68aa87b

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% assign baseurl = page.permalink | remove_first: "/" | remove_first: page.lang %}
2+
3+
{% for lang in site.languages %}
4+
{% assign localization = "/" | append: lang | append:baseurl %}
5+
{% assign locale = site.posts | where:"permalink", localization %}
6+
{% assign localizations = localizations | concat: locale %}
7+
{% endfor %}

_layouts/newsletter.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
---
44
<link rel="stylesheet" href="/assets/css/main.css">
55

6-
{% assign baseurl = page.permalink | remove_first: "/" | remove_first: page.lang %}
7-
8-
{% for lang in site.languages %}
9-
{% assign localization = "/" | append: lang | append:baseurl %}
10-
{% assign locale = site.posts | where:"permalink", localization %}
11-
{% assign localizations = localizations | concat: locale %}
12-
{% endfor %}
6+
{% include functions/localization-finder.md %}
137

148
<article class="newsletter">
159
<header class="post-header">

_layouts/post.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
---
44
<link rel="stylesheet" href="/assets/css/main.css">
55

6-
{% assign baseurl = page.permalink | remove_first: "/" | remove_first: page.lang %}
7-
8-
{% for lang in site.languages %}
9-
{% assign localization = "/" | append: lang | append:baseurl %}
10-
{% assign locale = site.posts | where:"permalink", localization %}
11-
{% assign localizations = localizations | concat: locale %}
12-
{% endfor %}
6+
{% include functions/localization-finder.md %}
137

148
<article class="post">
159

0 commit comments

Comments
 (0)