From b2d3e41df68cdd1ff866806189dc53d33a68b3a7 Mon Sep 17 00:00:00 2001 From: Mike Schmidt Date: Fri, 25 Oct 2019 12:27:37 -0500 Subject: [PATCH] add links to translated newsletters if available --- _config.yml | 3 +++ _layouts/newsletter.html | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/_config.yml b/_config.yml index 34877ffddc..b7e9fb60ea 100644 --- a/_config.yml +++ b/_config.yml @@ -58,3 +58,6 @@ defaults: collections: topics: output: true + +languages: + - ja \ No newline at end of file diff --git a/_layouts/newsletter.html b/_layouts/newsletter.html index 7d1908658d..8ea14b58dc 100644 --- a/_layouts/newsletter.html +++ b/_layouts/newsletter.html @@ -2,8 +2,23 @@ layout: default --- + +{% assign baseurl = page.permalink | remove_first: "/" | remove_first: page.lang %} + +{% for lang in site.languages %} + {% assign localization = "/" | append: lang | append:baseurl %} + {% assign locale = site.posts | where:"permalink", localization %} + {% assign localizations = localizations | concat: locale %} +{% endfor %} +
+ {% if localizations.size > 0 %} + en + {% for locale in localizations %} + | {{locale.lang}} + {% endfor %} + {% endif %}

{{ page.title | escape }}