Upgrade to zola 0.14.1

This commit is contained in:
Philipp Oppermann
2021-10-17 21:06:57 +02:00
parent 5c750985a6
commit 44f51402f7
9 changed files with 65 additions and 46 deletions

View File

@@ -70,16 +70,14 @@
<aside class="page-aside-right">
<div class="block" id="language-selector">
<h2>Other Languages</h2>
<ul>{%- for lang_code in config.languages | map(attribute="code") | concat(with="en") | sort -%}
{%- if lang_code != lang -%}
<li data-lang-switch-to="{{ lang_code }}" class="">
{%- if lang_code == "en" -%}
<a href="/">English (original)</a>
{%- else -%}
<a href="/{{ lang_code }}">{{ trans(key="lang_name", lang = lang_code) }}</a>
{%- endif -%}
</li>
{%- endif %}
{% set translations = section.translations | group_by(attribute="lang") %}
<ul>{%- for lang_code in config.extra.languages -%}
{%- set translation = translations[lang_code].0 -%}
{%- if translation and lang_code != lang -%}
<li data-lang-switch-to="{{ translation.lang }}" class=""><a href="{{ translation.permalink | safe }}">
{{ trans(key="lang_name", lang = translation.lang) }}
</a></li>
{%- endif -%}
{% endfor %}</ul>
</div>
<div class="block">

View File

@@ -17,7 +17,7 @@
{{ post.summary | safe }}
<a class="read-more" href="{{ post.path | safe }}"><em>{{ trans(key="readmore", lang=lang) | safe }}</em></a>
{%- if lang and not_translated and lang != config.default_language -%}
{%- if lang and not_translated and lang != config.extra.default_language -%}
<aside class="no-translation">
{{ trans(key="not_translated", lang=lang) }}
</aside>

View File

@@ -119,15 +119,15 @@
{% if page.translations -%}
<div class="block" id="language-selector">
<h2>Other Languages</h2>
<ul>{%- for translation in page.translations | sort(attribute="lang") %}
<li data-lang-switch-to="{{ translation.lang }}" class=""><a href="{{ translation.permalink | safe }}">
{%- if translation.lang == "en" -%}
English (original)
{%- else -%}
{% set translations = page.translations | group_by(attribute="lang") %}
<ul>{%- for lang_code in config.extra.languages -%}{%- if translations[lang_code] -%}
{%- set translation = translations[lang_code] | first -%}
{%- if translation and lang_code != lang -%}
<li data-lang-switch-to="{{ translation.lang }}" class=""><a href="{{ translation.permalink | safe }}">
{{ trans(key="lang_name", lang = translation.lang) }}
{%- endif -%}
</a></li>
{% endfor %}</ul>
</a></li>
{%- endif -%}
{%- endif -%}{% endfor %}</ul>
</div>
{%- endif %}

View File

@@ -4,7 +4,7 @@
<link>{{ config.base_url | safe }}</link>
<description>{{ config.description }}</description>
<generator>Zola</generator>
<language>{{ config.default_language }}</language>
<language>{{ lang }}</language>
<atom:link href="{{ feed_url | safe }}" rel="self" type="application/rss+xml"/>
<lastBuildDate>{{ last_updated | date(format="%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate>
{% for page in pages %}