From 62ebd4e5583e2fbce121b44ea821524447c0ead9 Mon Sep 17 00:00:00 2001
From: Mike Schmidt
Date: Fri, 25 Oct 2019 12:25:28 -0500
Subject: [PATCH 1/5] fixed missing closing tags in newsletter layout
---
_layouts/newsletter.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/_layouts/newsletter.html b/_layouts/newsletter.html
index 2af21b243..7d1908658 100644
--- a/_layouts/newsletter.html
+++ b/_layouts/newsletter.html
@@ -10,7 +10,8 @@ {{ page.title | escape }}
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{{ page.date | date: date_format }}
-
+
+
{{ content }}
From 7d32c2e2864dbace25dd9b309aedb3cce731b941 Mon Sep 17 00:00:00 2001
From: Mike Schmidt
Date: Fri, 25 Oct 2019 12:26:37 -0500
Subject: [PATCH 2/5] filter for en language on homepage, newsletters and
publications lists
---
en/publications.md | 4 +++-
index.md | 4 +++-
newsletters.md | 6 +++---
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/en/publications.md b/en/publications.md
index 56e8ddeb5..fa202b723 100644
--- a/en/publications.md
+++ b/en/publications.md
@@ -9,8 +9,10 @@ Recent publications from our [blog posts][] and [newsletters][].
[blog posts]: /en/blog/
[newsletters]: /en/newsletters/
+{% assign posts_en = site.posts | where:"lang","en" %}
+
- {%- for post in site.posts limit:20 -%}
+ {%- for post in posts_en limit:20 -%}
-
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{{ post.date | date: date_format }}
diff --git a/index.md b/index.md
index 97e105998..090900df4 100644
--- a/index.md
+++ b/index.md
@@ -26,9 +26,11 @@ and the open source community.
[about]: /about
[compatibility]: /en/compatibility/
+{% assign posts_en = site.posts | where:"lang","en" %}
+
Recent newsletters and blog posts
- {%- for post in site.posts limit:3 -%}
+ {%- for post in posts_en limit:3 -%}
-
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{{ post.date | date: date_format }}
diff --git a/newsletters.md b/newsletters.md
index ece4e2160..948a5fc66 100644
--- a/newsletters.md
+++ b/newsletters.md
@@ -11,9 +11,10 @@ version: 1
{% include newsletter-signup.html %}
+{% assign posts_newsletters_en = site.posts | where:"lang","en" | where:"type","newsletter" %}
+
- {%- for post in site.posts -%}
- {%- if post.type == 'newsletter' -%}
+ {%- for post in posts_newsletters_en -%}
-
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
{{ post.date | date: date_format }}
@@ -26,7 +27,6 @@ version: 1
{{ post.excerpt }}
{%- endif -%}
- {%- endif -%}
{%- endfor -%}
From 4a616250516bad1db4559692a9b55eb29944349d Mon Sep 17 00:00:00 2001
From: Mike Schmidt
Date: Fri, 25 Oct 2019 12:27:37 -0500
Subject: [PATCH 3/5] add links to translated newsletters if available
---
_config.yml | 3 +++
_layouts/newsletter.html | 17 +++++++++++++++++
assets/css/main.scss | 5 +++++
3 files changed, 25 insertions(+)
diff --git a/_config.yml b/_config.yml
index 34877ffdd..b7e9fb60e 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 7d1908658..4997e8099 100644
--- a/_layouts/newsletter.html
+++ b/_layouts/newsletter.html
@@ -2,8 +2,25 @@
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 %}
+