Add support for listing other languages versions in a post header
This commit is contained in:
parent
98e33603c1
commit
8a5e11234f
6 changed files with 36 additions and 0 deletions
|
|
@ -2,11 +2,22 @@
|
|||
layout: base.njk
|
||||
title: Adrian Victor:Blog
|
||||
---
|
||||
{% set altLanguages = collections.post | alternateLanguages(postId, langKey) %}
|
||||
<main>
|
||||
<article>
|
||||
<div id="postHeader">
|
||||
<h1>{{ postTitle }}</h1>
|
||||
<p>{{ authors or "Adrian Victor" }} - {{ date }}</p>
|
||||
{% if altLanguages.length > 0 %}
|
||||
{{ i18n[langKey].availableInOtherLanguages }}:
|
||||
{% for alt in altLanguages %}
|
||||
<li class="inlineList">
|
||||
<a href="{{ alt.url }}" hreflang="{{ alt.lang }}">
|
||||
{{ i18n[alt.lang].language }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ content | safe }}
|
||||
</article>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue