Skip to content

Commit

Permalink
[publications] Add publications index for other languages
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Nov 29, 2019
1 parent 8a48cfc commit cafa399
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 21 deletions.
40 changes: 40 additions & 0 deletions _layouts/publications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
type: pages
layout: default
---
<link rel="stylesheet" href="/assets/css/main.css">

<div class="localization">
<a href="/en/publications/">en</a>
{% for lang in site.languages %}
| <a href="/{{ lang }}/publications/">{{lang}}</a>
{% endfor %}
</div>

<h1 class="post-title">Publications</h1>

{% if content != ""%}
<div class="post-content">
{{ content }}
</div>
{%- endif -%}

{% assign posts = site.posts | where:"lang", page.lang %}

<ul class="post-list">
{%- for post in posts limit:20 -%}
<li>
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>

26 changes: 5 additions & 21 deletions en/publications.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
---
layout: publications
lang: en
title: Publications
layout: page
name: publications
permalink: /en/publications/
share: false
version: 1
---
{:.center}
Recent publications from our [blog posts][] and [newsletters][].

[blog posts]: /en/blog/
[newsletters]: /en/newsletters/

{% assign posts_en = site.posts | where:"lang","en" %}

<ul class="post-list">
{%- for post in posts_en limit:20 -%}
<li>
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
<span class="post-meta">{{ post.date | date: date_format }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title | escape }}
</a>
</h3>
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>

20 changes: 20 additions & 0 deletions ja/publications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
layout: publications
lang: ja
title: Publications-ja
name: publications-ja
permalink: /ja/publications/
share: false
version: 1
---
_Would you like to help translate our publications? See the [CONTRIBUTING
documentation](https://github.com/bitcoinops/bitcoinops.github.io/blob/master/CONTRIBUTING.md#translations)
and the [Japanese translation issues and
PRs](https://github.com/bitcoinops/bitcoinops.github.io/pulls?&q=label%3Alocalization-japanese)
in our github repo._

{:.center}
Recent publications from our [blog posts][] and [newsletters][].

[blog posts]: /ja/blog/
[newsletters]: /ja/newsletters/

0 comments on commit cafa399

Please sign in to comment.