1
0
Fork 0
forked from github/pelican

Add hreflang attribute to default themes

This commit is contained in:
Jorge Maldonado Ventura 2018-07-05 00:26:50 +02:00
commit d1d1cccdad
39 changed files with 104 additions and 37 deletions

View file

@ -53,7 +53,7 @@
<p>In <a href="/category/misc.html">misc</a>.</p>
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/baz.html">baz</a> </p>Translations:
<a href="/second-article-fr.html">fr</a>
<a href="/second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -53,7 +53,7 @@
<p>In <a href="/category/misc.html">misc</a>.</p>
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/baz.html">baz</a> </p>Translations:
<a href="/second-article-fr.html">fr</a>
<a href="/second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -5,6 +5,8 @@
<title>Deuxième article</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<link rel="alternate" hreflang="en" href="/second-article.html">
</head>
<body id="index" class="home">
@ -36,7 +38,7 @@
<p>In <a href="/category/misc.html">misc</a>.</p>
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/baz.html">baz</a> </p>Translations:
<a href="/second-article.html">en</a>
<a href="/second-article.html" hreflang="en">en</a>
</footer><!-- /.post-info --> <p>Ceci est un article, en français.</p>

View file

@ -5,6 +5,8 @@
<title>Second article</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<link rel="alternate" hreflang="fr" href="/second-article-fr.html">
</head>
<body id="index" class="home">
@ -36,7 +38,7 @@
<p>In <a href="/category/misc.html">misc</a>.</p>
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/baz.html">baz</a> </p>Translations:
<a href="/second-article-fr.html">fr</a>
<a href="/second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -31,7 +31,7 @@
<p>In <a href="/category/misc.html">misc</a>.</p>
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/baz.html">baz</a> </p>Translations:
<a href="/second-article-fr.html">fr</a>
<a href="/second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><p>This is some article, in english</p>
</article>

View file

@ -31,7 +31,7 @@
<p>In <a href="/category/misc.html">misc</a>.</p>
<p>tags: <a href="/tag/foo.html">foo</a> <a href="/tag/bar.html">bar</a> <a href="/tag/baz.html">baz</a> </p>Translations:
<a href="/second-article-fr.html">fr</a>
<a href="/second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><p>This is some article, in english</p>
</article>

View file

@ -63,7 +63,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -118,7 +118,7 @@ as well as <strong>inline markup</strong>.</p>
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -63,7 +63,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -63,7 +63,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
<p>tags: <a href="./tag/foo.html">foo</a> <a href="./tag/bar.html">bar</a> <a href="./tag/baz.html">baz</a> </p>Translations:
<a href="./second-article-fr.html">fr</a>
<a href="./second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -118,7 +118,7 @@ as well as <strong>inline markup</strong>.</p>
</address>
<p>In <a href="./category/bar.html">bar</a>.</p>
<p>tags: <a href="./tag/oh.html">oh</a> <a href="./tag/bar.html">bar</a> <a href="./tag/yeah.html">yeah</a> </p>Translations:
<a href="./oh-yeah-fr.html">fr</a>
<a href="./oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./oh-yeah.html">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
Translations:
<a href="./oh-yeah.html">en</a>
<a href="./oh-yeah.html" hreflang="en">en</a>
</footer><!-- /.post-info --> <p>Et voila du contenu en français</p>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="./oh-yeah-fr.html">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="./category/bar.html">bar</a>.</p>
<p>tags: <a href="./tag/oh.html">oh</a> <a href="./tag/bar.html">bar</a> <a href="./tag/yeah.html">yeah</a> </p>Translations:
<a href="./oh-yeah-fr.html">fr</a>
<a href="./oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./second-article.html">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
<p>tags: <a href="./tag/foo.html">foo</a> <a href="./tag/bar.html">bar</a> <a href="./tag/baz.html">baz</a> </p>Translations:
<a href="./second-article.html">en</a>
<a href="./second-article.html" hreflang="en">en</a>
</footer><!-- /.post-info --> <p>Ceci est un article, en français.</p>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="./second-article-fr.html">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
<p>tags: <a href="./tag/foo.html">foo</a> <a href="./tag/bar.html">bar</a> <a href="./tag/baz.html">baz</a> </p>Translations:
<a href="./second-article-fr.html">fr</a>
<a href="./second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><p>This is some article, in english</p>
<p>There are <a href="../second-article.html#disqus_thread">comments</a>.</p> </article>
@ -93,7 +93,7 @@ as well as <strong>inline markup</strong>.</p>
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><p>This is some article, in english</p>
<p>There are <a href="../second-article.html#disqus_thread">comments</a>.</p> </article>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -63,7 +63,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -118,7 +118,7 @@ as well as <strong>inline markup</strong>.</p>
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -63,7 +63,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -63,7 +63,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
<p>tags: <a href="./tag/foo.html">foo</a> <a href="./tag/bar.html">bar</a> <a href="./tag/baz.html">baz</a> </p>Translations:
<a href="./second-article-fr.html">fr</a>
<a href="./second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -118,7 +118,7 @@ as well as <strong>inline markup</strong>.</p>
</address>
<p>In <a href="./category/bar.html">bar</a>.</p>
<p>tags: <a href="./tag/oh.html">oh</a> <a href="./tag/bar.html">bar</a> <a href="./tag/yeah.html">yeah</a> </p>Translations:
<a href="./oh-yeah-fr.html">fr</a>
<a href="./oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./posts/2010/octobre/20/oh-yeah/">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
Translations:
<a href="./posts/2010/octobre/20/oh-yeah/">en</a>
<a href="./posts/2010/octobre/20/oh-yeah/" hreflang="en">en</a>
</footer><!-- /.post-info --> <p>Et voila du contenu en français</p>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="../../../../../oh-yeah-fr.html">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="../../../../../category/bar.html">bar</a>.</p>
<p>tags: <a href="../../../../../tag/oh.html">oh</a> <a href="../../../../../tag/bar.html">bar</a> <a href="../../../../../tag/yeah.html">yeah</a> </p>Translations:
<a href="../../../../../oh-yeah-fr.html">fr</a>
<a href="../../../../../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="../../../../../second-article-fr.html">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="../../../../../category/misc.html">misc</a>.</p>
<p>tags: <a href="../../../../../tag/foo.html">foo</a> <a href="../../../../../tag/bar.html">bar</a> <a href="../../../../../tag/baz.html">baz</a> </p>Translations:
<a href="../../../../../second-article-fr.html">fr</a>
<a href="../../../../../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <p>This is some article, in english</p>

View file

@ -6,6 +6,8 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./posts/2012/février/29/second-article/">
</head>
<body id="index" class="home">
@ -43,7 +45,7 @@
</address>
<p>In <a href="./category/misc.html">misc</a>.</p>
<p>tags: <a href="./tag/foo.html">foo</a> <a href="./tag/bar.html">bar</a> <a href="./tag/baz.html">baz</a> </p>Translations:
<a href="./posts/2012/février/29/second-article/">en</a>
<a href="./posts/2012/février/29/second-article/" hreflang="en">en</a>
</footer><!-- /.post-info --> <p>Ceci est un article, en français.</p>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><p>This is some article, in english</p>
<p>There are <a href="../posts/2012/février/29/second-article/#disqus_thread">comments</a>.</p> </article>
@ -93,7 +93,7 @@ as well as <strong>inline markup</strong>.</p>
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --> <div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/misc.html">misc</a>.</p>
<p>tags: <a href="../tag/foo.html">foo</a> <a href="../tag/bar.html">bar</a> <a href="../tag/baz.html">baz</a> </p>Translations:
<a href="../second-article-fr.html">fr</a>
<a href="../second-article-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><p>This is some article, in english</p>
<p>There are <a href="../posts/2012/février/29/second-article/#disqus_thread">comments</a>.</p> </article>

View file

@ -38,7 +38,7 @@
</address>
<p>In <a href="../category/bar.html">bar</a>.</p>
<p>tags: <a href="../tag/oh.html">oh</a> <a href="../tag/bar.html">bar</a> <a href="../tag/yeah.html">yeah</a> </p>Translations:
<a href="../oh-yeah-fr.html">fr</a>
<a href="../oh-yeah-fr.html" hreflang="fr">fr</a>
</footer><!-- /.post-info --><div class="section" id="why-not">
<h2>Why not ?</h2>

View file

@ -1,6 +1,14 @@
{% extends "base.html" %}
{% block html_lang %}{{ article.lang }}{% endblock %}
{% block title %}{{ article.title|striptags }}{% endblock %}
{% block extra_head %}
{% import 'translations.html' as translations with context %}
{% if translations.entry_hreflang(article) %}
{{ translations.entry_hreflang(article) }}
{% endif %}
{% endblock %}
{% block content %}
<section id="content" class="body">
<article>

View file

@ -10,6 +10,7 @@
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% block extra_head %}{% endblock extra_head %}
</head>
<body id="index" class="home">

View file

@ -1,6 +1,14 @@
{% extends "base.html" %}
{% block html_lang %}{{ page.lang }}{% endblock %}
{% block title %}{{ page.title }}{% endblock %}
{% block extra_head %}
{% import 'translations.html' as translations with context %}
{% if translations.entry_hreflang(page) %}
{{ translations.entry_hreflang(page) }}
{% endif %}
{% endblock %}
{% block content %}
<section id="content" class="body">
<h1 class="entry-title">{{ page.title }}</h1>

View file

@ -2,7 +2,15 @@
{% if article.translations %}
Translations:
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
<a href="{{ SITEURL }}/{{ translation.url }}" hreflang="{{ translation.lang }}">{{ translation.lang }}</a>
{% endfor %}
{% endif %}
{% endmacro %}
{% macro entry_hreflang(entry) %}
{% if entry.translations %}
{% for translation in entry.translations %}
<link rel="alternate" hreflang="{{ translation.lang }}" href="{{ SITEURL }}/{{ translation.url }}">
{% endfor %}
{% endif %}
{% endmacro %}

View file

@ -5,6 +5,12 @@
{% block head %}
{{ super() }}
{% import 'translations.html' as translations with context %}
{% if translations.entry_hreflang(article) %}
{{ translations.entry_hreflang(article) }}
{% endif %}
{% if article.description %}
<meta name="description" content="{{article.description}}" />
{% endif %}

View file

@ -3,6 +3,15 @@
{% block title %}{{ SITENAME }} - {{ page.title }}{%endblock%}
{% block head %}
{{ super() }}
{% import 'translations.html' as translations with context %}
{% if translations.entry_hreflang(page) %}
{{ translations.entry_hreflang(page) }}
{% endif %}
{% endblock %}
{% block content %}
<h1>{{ page.title }}</h1>
{% import 'translations.html' as translations with context %}

View file

@ -2,8 +2,15 @@
{% if article.translations %}
Translations:
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
<a href="{{ SITEURL }}/{{ translation.url }}" hreflang="{{ translation.lang }}">{{ translation.lang }}</a>
{% endfor %}
{% endif %}
{% endmacro %}
{% macro entry_hreflang(entry) %}
{% if entry.translations %}
{% for translation in entry.translations %}
<link rel="alternate" hreflang="{{ translation.lang }}" href="{{ SITEURL }}/{{ translation.url }}">
{% endfor %}
{% endif %}
{% endmacro %}