mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #589 from tpievila/translated_pages
List of translations for simple and notmyidea pages
This commit is contained in:
commit
6adfec2bd5
33 changed files with 169 additions and 1 deletions
|
|
@ -10,5 +10,6 @@
|
|||
{% endif %}
|
||||
<p>In <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p>
|
||||
{% include 'taglist.html' %}
|
||||
{% include 'translations.html' %}
|
||||
{% import 'translations.html' as translations with context %}
|
||||
{{ translations.translations_for(article) }}
|
||||
</footer><!-- /.post-info -->
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
{% block content %}
|
||||
<section id="content" class="body">
|
||||
<h1 class="entry-title">{{ page.title }}</h1>
|
||||
{% import 'translations.html' as translations with context %}
|
||||
{{ translations.translations_for(page) }}
|
||||
{% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf">get
|
||||
the pdf</a>{% endif %}
|
||||
{{ page.content }}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{% macro translations_for(article) %}
|
||||
{% if article.translations %}
|
||||
Translations:
|
||||
{% for translation in article.translations %}
|
||||
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
<h2 class="entry-title">
|
||||
<a href="{{ article.url }}" rel="bookmark"
|
||||
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
|
||||
{% import 'translations.html' as translations with context %}
|
||||
{{ translations.translations_for(article) }}
|
||||
</header>
|
||||
<footer class="post-info">
|
||||
<abbr class="published" title="{{ article.date.isoformat() }}">
|
||||
|
|
|
|||
|
|
@ -2,5 +2,8 @@
|
|||
{% block title %}{{ page.title }}{%endblock%}
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% import 'translations.html' as translations with context %}
|
||||
{{ translations.translations_for(page) }}
|
||||
|
||||
{{ page.content }}
|
||||
{% endblock %}
|
||||
|
|
|
|||
9
pelican/themes/simple/templates/translations.html
Normal file
9
pelican/themes/simple/templates/translations.html
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{% macro translations_for(article) %}
|
||||
{% if article.translations %}
|
||||
Translations:
|
||||
{% for translation in article.translations %}
|
||||
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
|
@ -76,6 +76,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>You're mutually oblivious.</p>
|
||||
</div><!-- /.entry-content -->
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 1</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 2</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 3</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>You're mutually oblivious.</p><p>There are <a href=".././a-markdown-powered-article.html#disqus_thread">comments</a>.</p>
|
||||
</article>
|
||||
|
||||
|
|
@ -113,6 +116,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 1</p>
|
||||
|
||||
|
|
@ -148,6 +154,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 2</p>
|
||||
|
||||
|
|
@ -183,6 +192,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 3</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -82,11 +82,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
|
|
@ -127,11 +130,14 @@ YEAH !</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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>This is some article, in english</p>
|
||||
|
||||
|
|
@ -167,6 +173,9 @@ Translations:
|
|||
<p>tags: <a href=".././tag/foo.html">foo</a><a href=".././tag/bar.html">bar</a><a href=".././tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p class="first last">Multi-line metadata should be supported
|
||||
as well as <strong>inline markup</strong>.</p>
|
||||
|
|
@ -203,6 +212,9 @@ as well as <strong>inline markup</strong>.</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Or completely awesome. Depends the needs.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>You're mutually oblivious.</p><p>There are <a href=".././a-markdown-powered-article.html#disqus_thread">comments</a>.</p>
|
||||
</article>
|
||||
|
||||
|
|
@ -113,6 +116,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 1</p>
|
||||
|
||||
|
|
@ -148,6 +154,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 2</p>
|
||||
|
||||
|
|
@ -183,6 +192,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 3</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
|
|
@ -119,6 +122,9 @@ Translations:
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Or completely awesome. Depends the needs.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@
|
|||
<p>tags: <a href=".././tag/foo.html">foo</a><a href=".././tag/bar.html">bar</a><a href=".././tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>Some content here !</p>
|
||||
<div class="section" id="this-is-a-simple-title">
|
||||
<h2>This is a simple title</h2>
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>This is a draft article, it should live under the /drafts/ folder and not be
|
||||
listed anywhere else.</p>
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</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>
|
||||
|
|
@ -119,6 +122,9 @@ Translations:
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>You're mutually oblivious.</p>
|
||||
<a class="readmore" href="./a-markdown-powered-article.html">read more</a>
|
||||
|
|
@ -153,6 +159,9 @@ Translations:
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 1</p>
|
||||
|
||||
|
|
@ -188,6 +197,9 @@ Translations:
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 2</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Article 3</p>
|
||||
|
||||
|
|
@ -117,6 +120,9 @@
|
|||
<p>tags: <a href="./tag/foo.html">foo</a><a href="./tag/bar.html">bar</a><a href="./tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p class="first last">Multi-line metadata should be supported
|
||||
as well as <strong>inline markup</strong>.</p>
|
||||
|
|
@ -153,11 +159,14 @@ as well as <strong>inline markup</strong>.</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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
|
|
@ -198,6 +207,9 @@ YEAH !</p>
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Or completely awesome. Depends the needs.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -76,11 +76,14 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
Translations:
|
||||
|
||||
<a href="./oh-yeah.html">en</a>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Et voila du contenu en français</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -76,11 +76,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@
|
|||
<section id="content" class="body">
|
||||
<h1 class="entry-title">This is a test hidden page</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>This is great for things like error(404) pages
|
||||
Anyone can see this page but it's not linked to anywhere!</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@
|
|||
<section id="content" class="body">
|
||||
<h1 class="entry-title">This is a test page</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p>Just an image.</p>
|
||||
<img alt="alternate text" src="../static/pictures/Fat_Cat.jpg" style="width: 600px; height: 450px;" />
|
||||
|
||||
|
|
|
|||
|
|
@ -76,11 +76,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Ceci est un article, en français.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -76,11 +76,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>This is some article, in english</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>Ceci est un article, en français.</p>
|
||||
<p>There are <a href=".././second-article-fr.html#disqus_thread">comments</a>.</p>
|
||||
</article>
|
||||
|
|
@ -119,11 +122,14 @@ Translations:
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>This is some article, in english</p>
|
||||
|
||||
|
|
@ -159,6 +165,9 @@ Translations:
|
|||
<p>tags: <a href=".././tag/foo.html">foo</a><a href=".././tag/bar.html">bar</a><a href=".././tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p class="first last">Multi-line metadata should be supported
|
||||
as well as <strong>inline markup</strong>.</p>
|
||||
|
|
@ -195,11 +204,14 @@ as well as <strong>inline markup</strong>.</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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>Ceci est un article, en français.</p>
|
||||
<p>There are <a href=".././second-article-fr.html#disqus_thread">comments</a>.</p>
|
||||
</article>
|
||||
|
|
@ -119,11 +122,14 @@ Translations:
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>This is some article, in english</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>Ceci est un article, en français.</p>
|
||||
<p>There are <a href=".././second-article-fr.html#disqus_thread">comments</a>.</p>
|
||||
</article>
|
||||
|
|
@ -119,11 +122,14 @@ Translations:
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>This is some article, in english</p>
|
||||
|
||||
|
|
@ -159,6 +165,9 @@ Translations:
|
|||
<p>tags: <a href=".././tag/foo.html">foo</a><a href=".././tag/bar.html">bar</a><a href=".././tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p class="first last">Multi-line metadata should be supported
|
||||
as well as <strong>inline markup</strong>.</p>
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@
|
|||
<p>tags: <a href=".././tag/foo.html">foo</a><a href=".././tag/bar.html">bar</a><a href=".././tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><p>Some content here !</p>
|
||||
<div class="section" id="this-is-a-simple-title">
|
||||
<h2>This is a simple title</h2>
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@
|
|||
<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>
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info --><div class="section" id="why-not">
|
||||
<h2>Why not ?</h2>
|
||||
<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
<p>tags: <a href="./tag/foo.html">foo</a><a href="./tag/bar.html">bar</a><a href="./tag/foobar.html">foobar</a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Some content here !</p>
|
||||
<div class="section" id="this-is-a-simple-title">
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</footer><!-- /.post-info -->
|
||||
<p>Or completely awesome. Depends the needs.</p>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue