Show links to community translated posts

This commit is contained in:
Philipp Oppermann
2019-11-27 15:00:42 +01:00
parent d1da7f4a47
commit a1020cde7d
2 changed files with 12 additions and 0 deletions

View File

@@ -102,6 +102,10 @@ main img {
margin-left: 5px;
}
.post-translation {
margin-top: .3rem;
}
.post-category {
margin-right: 0.5rem;
text-transform: uppercase;

View File

@@ -4,6 +4,14 @@
<div class="post-summary">
{{ page.summary | safe}}
<a class="read-more" href="/{{ page.path | safe }}">read&nbsp;more…</a>
{% set translations = page.translations | filter(attribute="lang", value=lang) %}
{% if translations %}
<div class="post-translation">
{% set post = translations.0 %}
<b>Community Translation: <a href="{{ post.permalink }}">{{ post.title }}</a></b>
</div>
{% endif %}
</div>
</div>
{% endmacro post_link %}