Skip to content

Commit

Permalink
add links to translated newsletters if available
Browse files Browse the repository at this point in the history
  • Loading branch information
bitschmidty committed Oct 30, 2019
1 parent b4e2fc6 commit b2d3e41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ defaults:
collections:
topics:
output: true

languages:
- ja
15 changes: 15 additions & 0 deletions _layouts/newsletter.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@
layout: default
---
<link rel="stylesheet" href="/assets/css/main.css">

{% 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 %}

<article class="newsletter">
<header class="post-header">
{% if localizations.size > 0 %}
<a href="{{ '/en' | append:baseurl }}">en</a>
{% for locale in localizations %}
| <a href="{{ locale.url }}">{{locale.lang}}</a>
{% endfor %}
{% endif %}
<h1 class="post-title">{{ page.title | escape }}</h1>
<p class="post-meta">
<time class="dt-published" datetime="{{ page.date | date_to_xmlschema }}">
Expand Down

0 comments on commit b2d3e41

Please sign in to comment.