diff --git a/.gitignore b/.gitignore index 2849524dadcf58286d1ba3cb63afc84011947bfa..b71f8903f6b340d33c624509b5504a90189ee096 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ include/ lib/ local/ output/ -pelican-plugins/ pelican.pid pelicanconf.pyc pip-selfcheck.json diff --git a/pelican-plugins/i18n_subsites/README.rst b/pelican-plugins/i18n_subsites/README.rst index 12e113d3a747921e979461bf170e541078692eef..340109b135ab79ce871b2d14f081495da4aadde9 100644 --- a/pelican-plugins/i18n_subsites/README.rst +++ b/pelican-plugins/i18n_subsites/README.rst @@ -53,6 +53,15 @@ dictionary must be given (but can be empty) in the ``I18N_SUBSITES`` dictionary } } +You must also have the following in your pelican configuration + +.. code-block:: python + JINJA_ENVIRONMENT = { + 'extensions': ['jinja2.ext.i18n'], + } + + + Default and special overrides ----------------------------- The settings overrides may contain arbitrary settings, however, there diff --git a/pelican-plugins/i18n_subsites/i18n_subsites.py b/pelican-plugins/i18n_subsites/i18n_subsites.py index 388e758b2c592b8f79da651d277c6302e2ec8ec0..dc27799d41bbf7d89d701fc1bfd47006bd409a26 100644 --- a/pelican-plugins/i18n_subsites/i18n_subsites.py +++ b/pelican-plugins/i18n_subsites/i18n_subsites.py @@ -12,7 +12,10 @@ import posixpath from copy import copy from itertools import chain from operator import attrgetter -from collections import OrderedDict +try: + from collections.abc import OrderedDict +except ImportError: + from collections import OrderedDict from contextlib import contextmanager from six.moves.urllib.parse import urlparse @@ -22,7 +25,10 @@ import locale from pelican import signals from pelican.generators import ArticlesGenerator, PagesGenerator from pelican.settings import configure_settings -from pelican.contents import Draft +try: + from pelican.contents import Draft +except ImportError: + from pelican.contents import Article as Draft # Global vars @@ -353,13 +359,19 @@ def interlink_static_files(generator): '''Add links to static files in the main site if necessary''' if generator.settings['STATIC_PATHS'] != []: return # customized STATIC_PATHS - filenames = generator.context['filenames'] # minimize attr lookup + try: # minimize attr lookup + static_content = generator.context['static_content'] + except KeyError: + static_content = generator.context['filenames'] relpath = relpath_to_site(generator.settings['DEFAULT_LANG'], _MAIN_LANG) for staticfile in _MAIN_STATIC_FILES: - if staticfile.get_relative_source_path() not in filenames: + if staticfile.get_relative_source_path() not in static_content: staticfile = copy(staticfile) # prevent override in main site staticfile.override_url = posixpath.join(relpath, staticfile.url) - generator.add_source_path(staticfile) + try: + generator.add_source_path(staticfile, static=True) + except TypeError: + generator.add_source_path(staticfile) def save_main_static_files(static_generator): diff --git a/pelican-plugins/i18n_subsites/implementing_language_buttons.rst b/pelican-plugins/i18n_subsites/implementing_language_buttons.rst index 43f8bb3da0694e573159b2caf7d537c664c404e9..55b7bf3e63aca7089fa63f4b89188ba5a5af6c88 100644 --- a/pelican-plugins/i18n_subsites/implementing_language_buttons.rst +++ b/pelican-plugins/i18n_subsites/implementing_language_buttons.rst @@ -39,7 +39,7 @@ with local development when ``SITEURL == ''``. Language buttons showing all available languages, current is active ................................................................... -The ``extra_siteurls`` dictionary is a mapping of all languages to the +The ``lang_subsites`` dictionary is a mapping of all languages to the ``SITEURL`` of the respective (sub-)sites. This template sets the language of the current (sub-)site as active. diff --git a/pelican-plugins/i18n_subsites/localizing_using_jinja2.rst b/pelican-plugins/i18n_subsites/localizing_using_jinja2.rst index 6ffe65413593b097b3568bc0b09f37f3f5ac348e..a28beddf8b1d925d490955bb2e4bc58e45a641ca 100644 --- a/pelican-plugins/i18n_subsites/localizing_using_jinja2.rst +++ b/pelican-plugins/i18n_subsites/localizing_using_jinja2.rst @@ -6,11 +6,13 @@ Localizing themes with Jinja2 --------------------- To enable the |ext| extension in your templates, you must add it to -``JINJA_EXTENSIONS`` in your Pelican configuration +``JINJA_ENVIRONMENT`` in your Pelican configuration .. code-block:: python - JINJA_EXTENSIONS = ['jinja2.ext.i18n', ...] + JINJA_ENVIRONMENT = { + 'extensions': ['jinja2.ext.i18n', ...] + } Then follow the `Jinja2 templating documentation for the I18N plugin <http://jinja.pocoo.org/docs/templates/#i18n>`_ to make your templates diff --git a/pelican-plugins/i18n_subsites/test_data/output/an-untranslated-article.html b/pelican-plugins/i18n_subsites/test_data/output/an-untranslated-article.html index f45a10342ca12985761d7caf0a8872e50db36c9d..f2f6494994ca228f467611e4f1c244e5eb7e2989 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/an-untranslated-article.html +++ b/pelican-plugins/i18n_subsites/test_data/output/an-untranslated-article.html @@ -1,22 +1,26 @@ <!DOCTYPE html> <html lang="en"> <head> - <title>Welcome to our Testing site</title> + <title>Testing site - An untranslated article</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/theme/style.css" /> + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1> + <h1><a href="http://example.com/test/">Testing site</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> <li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li> + <li class="active"><a href="http://example.com/test/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content" class="body"> <header> @@ -32,6 +36,9 @@ <address class="vcard author"> By <a class="url fn" href="http://example.com/test/author/the-tester.html">The Tester</a> </address> + <div class="category"> + Category: <a href="http://example.com/test/category/misc.html">misc</a> + </div> </footer><!-- /.post-info --> <div class="entry-content"> <p>An article without a translation. @@ -41,8 +48,8 @@ Here is a link to an <a class="reference external" href="http://example.com/test </section> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/cz/an-untranslated-article-en.html b/pelican-plugins/i18n_subsites/test_data/output/cz/an-untranslated-article-en.html index 1871ee6b2bc57ecad9fa75a365b7d8f5c222ee13..4673ee5127a4d205e10f638f4149e4cb02f9702c 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/cz/an-untranslated-article-en.html +++ b/pelican-plugins/i18n_subsites/test_data/output/cz/an-untranslated-article-en.html @@ -1,21 +1,25 @@ <!DOCTYPE html> -<html lang="cz"> +<html lang="en"> <head> - <title>Welcome to our Testovací stránka</title> + <title>Testovací stránka - An untranslated article</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" /> + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1> + <h1><a href="http://example.com/test/cz/">Testovací stránka</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li class="active"><a href="http://example.com/test/cz/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content" class="body"> <header> @@ -31,17 +35,20 @@ <address class="vcard author"> By <a class="url fn" href="http://example.com/test/cz/author/test-testovic.html">Test Testovič</a> </address> + <div class="category"> + Category: <a href="http://example.com/test/cz/category/misc.html">misc</a> + </div> </footer><!-- /.post-info --> <div class="entry-content"> <p>An article without a translation. -Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p> +Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p> </div><!-- /.entry-content --> </section> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/cz/feeds_all.atom.xml b/pelican-plugins/i18n_subsites/test_data/output/cz/feeds_all.atom.xml index e6797c25e7373a7809c1e8a0027a51f414947694..7415e1fc91f1da322576c01090b07dfdfd0037fc 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/cz/feeds_all.atom.xml +++ b/pelican-plugins/i18n_subsites/test_data/output/cz/feeds_all.atom.xml @@ -1,18 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<feed xmlns="http://www.w3.org/2005/Atom"><title>Testovací stránka</title><link href="http://example.com/test/cz/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/cz/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><summary type="html"><p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p> -</summary><content type="html"><p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p> -</content></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/cz/../de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-14:/test/cz/../de/translated-article.html</id><summary type="html"><p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/cz/../images/img.png">einigem Bild</a>.</p> -</summary><content type="html"><p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/cz/../images/img.png">einigem Bild</a>.</p> -</content></entry><entry><title>A translated article</title><link href="http://example.com/test/cz/../translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-13:/test/cz/../translated-article.html</id><summary type="html"><p>A simple article with a translation. -Here is a link to <a class="reference external" href="http://example.com/test/cz/../images/img.png">some image</a>.</p> -</summary><content type="html"><p>A simple article with a translation. -Here is a link to <a class="reference external" href="http://example.com/test/cz/../images/img.png">some image</a>.</p> -</content></entry><entry><title>An untranslated article</title><link href="http://example.com/test/cz/an-untranslated-article-en.html" rel="alternate"></link><published>2014-07-14T00:00:00+00:00</published><updated>2014-07-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-07-14:/test/cz/an-untranslated-article-en.html</id><summary type="html"><p>An article without a translation. -Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p> -</summary><content type="html"><p>An article without a translation. -Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p> -</content></entry></feed> \ No newline at end of file +<feed xmlns="http://www.w3.org/2005/Atom"><title>Testovací stránka</title><link href="http://example.com/test/cz/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/cz/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html"><p>Jednoduchý článek s překlady. +Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p> +</content><category term="misc"></category></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html"><p>Ein einfacher Artikel mit einer Übersetzung. +Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p> +</content><category term="misc"></category></entry><entry><title>A translated article</title><link href="http://example.com/test/translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-09-13:/test/translated-article.html</id><content type="html"><p>A simple article with a translation. +Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p> +</content><category term="misc"></category></entry><entry><title>An untranslated article</title><link href="http://example.com/test/cz/an-untranslated-article-en.html" rel="alternate"></link><published>2014-07-14T00:00:00+00:00</published><updated>2014-07-14T00:00:00+00:00</updated><author><name>Test Testovič</name></author><id>tag:example.com,2014-07-14:/test/cz/an-untranslated-article-en.html</id><content type="html"><p>An article without a translation. +Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p> +</content><category term="misc"></category></entry></feed> \ No newline at end of file diff --git a/pelican-plugins/i18n_subsites/test_data/output/cz/index.html b/pelican-plugins/i18n_subsites/test_data/output/cz/index.html index 08dce152a6e3ed8d17b893abcb3601cd419691dc..c5fca32201318e0dbd9186e05938362c813ff9f8 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/cz/index.html +++ b/pelican-plugins/i18n_subsites/test_data/output/cz/index.html @@ -3,6 +3,7 @@ <head> <title>Welcome to our Testovací stránka</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" /> @@ -10,9 +11,10 @@ <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1> + <h1><a href="http://example.com/test/cz/">Testovací stránka</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li><a href="http://example.com/test/cz/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content"> <h2>All articles</h2> @@ -27,7 +29,7 @@ </address> </footer><!-- /.post-info --> <div class="entry-content"> <p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p> +Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p> </div><!-- /.entry-content --> </article></li> <li><article class="hentry"> @@ -39,15 +41,15 @@ Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/. </address> </footer><!-- /.post-info --> <div class="entry-content"> <p>An article without a translation. -Here is a link to an <a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html">untranslated page</a></p> +Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p> </div><!-- /.entry-content --> </article></li> </ol><!-- /#posts-list --> </section><!-- /#content --> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/cz/pages/404.html b/pelican-plugins/i18n_subsites/test_data/output/cz/pages/404.html index c6e659d9ff015a050e375f81d4f62e8eb31367e7..884203bcce204281122ecae02f349d0f102dbf52 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/cz/pages/404.html +++ b/pelican-plugins/i18n_subsites/test_data/output/cz/pages/404.html @@ -1,23 +1,30 @@ <!DOCTYPE html> <html lang="cz"> <head> - <title>404 stránka</title> + <title>Testovací stránka - 404 stránka</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" /> + + + <link rel="alternate" hreflang="de" href="http://example.com/test/cz/../de/pages/404.html"> + <link rel="alternate" hreflang="en" href="http://example.com/test/cz/../pages/404.html"> + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1> + <h1><a href="http://example.com/test/cz/">Testovací stránka</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li><a href="http://example.com/test/cz/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <h1>404 stránka</h1> - Translations: -<a href="http://example.com/test/cz/../de/pages/404.html">de</a> -<a href="http://example.com/test/cz/../pages/404.html">en</a> + Translations: +<a href="http://example.com/test/cz/../de/pages/404.html" hreflang="de">de</a> +<a href="http://example.com/test/cz/../pages/404.html" hreflang="en">en</a> <p>Jednoduchá 404 stránka.</p> @@ -25,9 +32,9 @@ <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> -</html> \ No newline at end of file +</html> diff --git a/pelican-plugins/i18n_subsites/test_data/output/cz/translated-article.html b/pelican-plugins/i18n_subsites/test_data/output/cz/translated-article.html index 9402c9a28fa09e0ea17c81eac45f0e9dd8c7549a..5a5e5458c5b1394fa8859f27cb3669da8c11c453 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/cz/translated-article.html +++ b/pelican-plugins/i18n_subsites/test_data/output/cz/translated-article.html @@ -1,30 +1,37 @@ <!DOCTYPE html> <html lang="cz"> <head> - <title>Welcome to our Testovací stránka</title> + <title>Testovací stránka - Přeložený článek</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testovací stránka Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/cz/../theme/style.css" /> + <link rel="alternate" hreflang="de" href="http://example.com/test/cz/../de/translated-article.html"> + <link rel="alternate" hreflang="en" href="http://example.com/test/cz/../translated-article.html"> + + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/cz/">Testovací stránka <strong></strong></a></h1> + <h1><a href="http://example.com/test/cz/">Testovací stránka</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li class="active"><a href="http://example.com/test/cz/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content" class="body"> <header> <h2 class="entry-title"> <a href="http://example.com/test/cz/translated-article.html" rel="bookmark" title="Permalink to Přeložený článek">Přeložený článek</a></h2> - Translations: -<a href="http://example.com/test/cz/../de/translated-article.html">de</a> -<a href="http://example.com/test/cz/../translated-article.html">en</a> + Translations: +<a href="http://example.com/test/cz/../de/translated-article.html" hreflang="de">de</a> +<a href="http://example.com/test/cz/../translated-article.html" hreflang="en">en</a> </header> <footer class="post-info"> @@ -34,17 +41,20 @@ <address class="vcard author"> By <a class="url fn" href="http://example.com/test/cz/author/test-testovic.html">Test Testovič</a> </address> + <div class="category"> + Category: <a href="http://example.com/test/cz/category/misc.html">misc</a> + </div> </footer><!-- /.post-info --> <div class="entry-content"> <p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/cz/../images/img.png">nějaký obrázek</a>.</p> +Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p> </div><!-- /.entry-content --> </section> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/de/drafts/an-untranslated-article-en.html b/pelican-plugins/i18n_subsites/test_data/output/de/drafts/an-untranslated-article-en.html index e58078f8c2b72a724e1bdc1227d500d9f63a543e..f01dc3105c59e0946ac69d9eff49110b50aba5e2 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/de/drafts/an-untranslated-article-en.html +++ b/pelican-plugins/i18n_subsites/test_data/output/de/drafts/an-untranslated-article-en.html @@ -1,21 +1,25 @@ <!DOCTYPE html> -<html lang="de"> +<html lang="en"> <head> - <title>Willkommen Sie zur unserer Testseite</title> + <title>Testseite - An untranslated article</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" /> + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1> + <h1><a href="http://example.com/test/de/">Testseite</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li class="active"><a href="http://example.com/test/de/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content" class="body"> <header> @@ -26,11 +30,14 @@ </header> <footer class="post-info"> <time class="published" datetime="2014-07-14T00:00:00+00:00"> - Mon 14 July 2014 + Mo 14 Juli 2014 </time> <address class="vcard author"> By <a class="url fn" href="http://example.com/test/de/author/der-tester.html">Der Tester</a> </address> + <div class="category"> + Category: <a href="http://example.com/test/de/category/misc.html">misc</a> + </div> </footer><!-- /.post-info --> <div class="entry-content"> <p>An article without a translation. @@ -40,8 +47,8 @@ Here is a link to an <a class="reference external" href="http://example.com/test </section> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/de/feeds_all.atom.xml b/pelican-plugins/i18n_subsites/test_data/output/de/feeds_all.atom.xml index b5f596ba811bd99b0000a1d5849768cb5e66ce41..8d845fe0739adbc1bfe2045e382eb2fa781a237b 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/de/feeds_all.atom.xml +++ b/pelican-plugins/i18n_subsites/test_data/output/de/feeds_all.atom.xml @@ -1,14 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<feed xmlns="http://www.w3.org/2005/Atom"><title>Testseite</title><link href="http://example.com/test/de/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/de/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/de/../cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-15:/test/de/../cz/translated-article.html</id><summary type="html"><p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/de/../images/img.png">nějaký obrázek</a>.</p> -</summary><content type="html"><p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/de/../images/img.png">nějaký obrázek</a>.</p> -</content></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><summary type="html"><p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p> -</summary><content type="html"><p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p> -</content></entry><entry><title>A translated article</title><link href="http://example.com/test/de/../translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-13:/test/de/../translated-article.html</id><summary type="html"><p>A simple article with a translation. -Here is a link to <a class="reference external" href="http://example.com/test/de/../images/img.png">some image</a>.</p> -</summary><content type="html"><p>A simple article with a translation. -Here is a link to <a class="reference external" href="http://example.com/test/de/../images/img.png">some image</a>.</p> -</content></entry></feed> \ No newline at end of file +<feed xmlns="http://www.w3.org/2005/Atom"><title>Testseite</title><link href="http://example.com/test/de/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/de/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html"><p>Jednoduchý článek s překlady. +Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p> +</content><category term="misc"></category></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html"><p>Ein einfacher Artikel mit einer Übersetzung. +Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p> +</content><category term="misc"></category></entry><entry><title>A translated article</title><link href="http://example.com/test/translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>Der Tester</name></author><id>tag:example.com,2014-09-13:/test/translated-article.html</id><content type="html"><p>A simple article with a translation. +Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p> +</content><category term="misc"></category></entry></feed> \ No newline at end of file diff --git a/pelican-plugins/i18n_subsites/test_data/output/de/index.html b/pelican-plugins/i18n_subsites/test_data/output/de/index.html index 8dee6a7203c0a2b33d5d48dfb6fced45f9d83fc0..fc43ae1b07ef339a7a2d12beb244c7a30a2386bf 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/de/index.html +++ b/pelican-plugins/i18n_subsites/test_data/output/de/index.html @@ -3,6 +3,7 @@ <head> <title>Willkommen Sie zur unserer Testseite</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" /> @@ -10,9 +11,10 @@ <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1> + <h1><a href="http://example.com/test/de/">Testseite</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li><a href="http://example.com/test/de/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content"> <h2>All articles</h2> @@ -21,21 +23,21 @@ <li><article class="hentry"> <header> <h2 class="entry-title"><a href="http://example.com/test/de/translated-article.html" rel="bookmark" title="Permalink to Ein übersetzter Artikel">Ein übersetzter Artikel</a></h2> </header> <footer class="post-info"> - <time class="published" datetime="2014-09-14T00:00:00+00:00"> Sun 14 September 2014 </time> + <time class="published" datetime="2014-09-14T00:00:00+00:00"> So 14 September 2014 </time> <address class="vcard author">By <a class="url fn" href="http://example.com/test/de/author/der-tester.html">Der Tester</a> </address> </footer><!-- /.post-info --> <div class="entry-content"> <p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p> +Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p> </div><!-- /.entry-content --> </article></li> </ol><!-- /#posts-list --> </section><!-- /#content --> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/de/pages/404.html b/pelican-plugins/i18n_subsites/test_data/output/de/pages/404.html index b1721f5cece46a745bed16ec4333210cdb6c4f58..642566079c8dd1a5930497254175d875b9a59c1d 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/de/pages/404.html +++ b/pelican-plugins/i18n_subsites/test_data/output/de/pages/404.html @@ -1,23 +1,30 @@ <!DOCTYPE html> <html lang="de"> <head> - <title>Eine 404 Seite</title> + <title>Testseite - Eine 404 Seite</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" /> + + + <link rel="alternate" hreflang="cz" href="http://example.com/test/de/../cz/pages/404.html"> + <link rel="alternate" hreflang="en" href="http://example.com/test/de/../pages/404.html"> + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1> + <h1><a href="http://example.com/test/de/">Testseite</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li><a href="http://example.com/test/de/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <h1>Eine 404 Seite</h1> - Translations: -<a href="http://example.com/test/de/../cz/pages/404.html">cz</a> -<a href="http://example.com/test/de/../pages/404.html">en</a> + Translations: +<a href="http://example.com/test/de/../cz/pages/404.html" hreflang="cz">cz</a> +<a href="http://example.com/test/de/../pages/404.html" hreflang="en">en</a> <p>Eine einfache 404 Seite.</p> @@ -25,8 +32,8 @@ <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/de/pages/untranslated-page-en.html b/pelican-plugins/i18n_subsites/test_data/output/de/pages/untranslated-page-en.html index 9873cbd20f490ef8450ff3420a1667ec9e0d88df..2df5ff994bc0ea2d3660c866e95324d34be97d3c 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/de/pages/untranslated-page-en.html +++ b/pelican-plugins/i18n_subsites/test_data/output/de/pages/untranslated-page-en.html @@ -1,18 +1,22 @@ <!DOCTYPE html> -<html lang="de"> +<html lang="en"> <head> - <title>Untranslated page</title> + <title>Testseite - Untranslated page</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" /> + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1> + <h1><a href="http://example.com/test/de/">Testseite</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li><a href="http://example.com/test/de/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <h1>Untranslated page</h1> @@ -22,8 +26,8 @@ <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/de/translated-article.html b/pelican-plugins/i18n_subsites/test_data/output/de/translated-article.html index bd26a8347b05756e0802b90141ea8f1424ab20fe..9393b953daba53049d0d14c7bbb9cf238419c3e6 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/de/translated-article.html +++ b/pelican-plugins/i18n_subsites/test_data/output/de/translated-article.html @@ -1,50 +1,60 @@ <!DOCTYPE html> <html lang="de"> <head> - <title>Willkommen Sie zur unserer Testseite</title> + <title>Testseite - Ein übersetzter Artikel</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testseite Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/de/../theme/style.css" /> + <link rel="alternate" hreflang="cz" href="http://example.com/test/de/../cz/translated-article.html"> + <link rel="alternate" hreflang="en" href="http://example.com/test/de/../translated-article.html"> + + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/de/">Testseite <strong></strong></a></h1> + <h1><a href="http://example.com/test/de/">Testseite</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> + <li class="active"><a href="http://example.com/test/de/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content" class="body"> <header> <h2 class="entry-title"> <a href="http://example.com/test/de/translated-article.html" rel="bookmark" title="Permalink to Ein übersetzter Artikel">Ein übersetzter Artikel</a></h2> - Translations: -<a href="http://example.com/test/de/../cz/translated-article.html">cz</a> -<a href="http://example.com/test/de/../translated-article.html">en</a> + Translations: +<a href="http://example.com/test/de/../cz/translated-article.html" hreflang="cz">cz</a> +<a href="http://example.com/test/de/../translated-article.html" hreflang="en">en</a> </header> <footer class="post-info"> <time class="published" datetime="2014-09-14T00:00:00+00:00"> - Sun 14 September 2014 + So 14 September 2014 </time> <address class="vcard author"> By <a class="url fn" href="http://example.com/test/de/author/der-tester.html">Der Tester</a> </address> + <div class="category"> + Category: <a href="http://example.com/test/de/category/misc.html">misc</a> + </div> </footer><!-- /.post-info --> <div class="entry-content"> <p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/de/../images/img.png">einigem Bild</a>.</p> +Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p> </div><!-- /.entry-content --> </section> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/feeds_all.atom.xml b/pelican-plugins/i18n_subsites/test_data/output/feeds_all.atom.xml index 609cf994d9d4e3c305e32666032d95d5860aba07..c6c090856a72347cc886ee8e70a3753b9eda0780 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/feeds_all.atom.xml +++ b/pelican-plugins/i18n_subsites/test_data/output/feeds_all.atom.xml @@ -1,18 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<feed xmlns="http://www.w3.org/2005/Atom"><title>Testing site</title><link href="http://example.com/test/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><summary type="html"><p>Jednoduchý článek s překlady. +<feed xmlns="http://www.w3.org/2005/Atom"><title>Testing site</title><link href="http://example.com/test/" rel="alternate"></link><link href="http://example.com/test/feeds_all.atom.xml" rel="self"></link><id>http://example.com/test/</id><updated>2014-09-15T00:00:00+00:00</updated><entry><title>Přeložený článek</title><link href="http://example.com/test/cz/translated-article.html" rel="alternate"></link><published>2014-09-15T00:00:00+00:00</published><updated>2014-09-15T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-15:/test/cz/translated-article.html</id><content type="html"><p>Jednoduchý článek s překlady. Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p> -</summary><content type="html"><p>Jednoduchý článek s překlady. -Zde je odkaz na <a class="reference external" href="http://example.com/test/images/img.png">nějaký obrázek</a>.</p> -</content></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><summary type="html"><p>Ein einfacher Artikel mit einer Übersetzung. -Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p> -</summary><content type="html"><p>Ein einfacher Artikel mit einer Übersetzung. +</content><category term="misc"></category></entry><entry><title>Ein übersetzter Artikel</title><link href="http://example.com/test/de/translated-article.html" rel="alternate"></link><published>2014-09-14T00:00:00+00:00</published><updated>2014-09-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-14:/test/de/translated-article.html</id><content type="html"><p>Ein einfacher Artikel mit einer Übersetzung. Hier ist ein Link zur <a class="reference external" href="http://example.com/test/images/img.png">einigem Bild</a>.</p> -</content></entry><entry><title>A translated article</title><link href="http://example.com/test/translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-13:/test/translated-article.html</id><summary type="html"><p>A simple article with a translation. +</content><category term="misc"></category></entry><entry><title>A translated article</title><link href="http://example.com/test/translated-article.html" rel="alternate"></link><published>2014-09-13T00:00:00+00:00</published><updated>2014-09-13T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-09-13:/test/translated-article.html</id><content type="html"><p>A simple article with a translation. Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p> -</summary><content type="html"><p>A simple article with a translation. -Here is a link to <a class="reference external" href="http://example.com/test/images/img.png">some image</a>.</p> -</content></entry><entry><title>An untranslated article</title><link href="http://example.com/test/an-untranslated-article.html" rel="alternate"></link><published>2014-07-14T00:00:00+00:00</published><updated>2014-07-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-07-14:/test/an-untranslated-article.html</id><summary type="html"><p>An article without a translation. -Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p> -</summary><content type="html"><p>An article without a translation. +</content><category term="misc"></category></entry><entry><title>An untranslated article</title><link href="http://example.com/test/an-untranslated-article.html" rel="alternate"></link><published>2014-07-14T00:00:00+00:00</published><updated>2014-07-14T00:00:00+00:00</updated><author><name>The Tester</name></author><id>tag:example.com,2014-07-14:/test/an-untranslated-article.html</id><content type="html"><p>An article without a translation. Here is a link to an <a class="reference external" href="http://example.com/test/pages/untranslated-page.html">untranslated page</a></p> -</content></entry></feed> \ No newline at end of file +</content><category term="misc"></category></entry></feed> \ No newline at end of file diff --git a/pelican-plugins/i18n_subsites/test_data/output/index.html b/pelican-plugins/i18n_subsites/test_data/output/index.html index 5779f4f18d0ce4d09173da464175732a574eb072..c45568707bff3978fd15b804f6f0a863ab8075e6 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/index.html +++ b/pelican-plugins/i18n_subsites/test_data/output/index.html @@ -3,6 +3,7 @@ <head> <title>Welcome to our Testing site</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/theme/style.css" /> @@ -10,10 +11,11 @@ <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1> + <h1><a href="http://example.com/test/">Testing site</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> <li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li> + <li><a href="http://example.com/test/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content"> <h2>All articles</h2> @@ -47,8 +49,8 @@ Here is a link to an <a class="reference external" href="http://example.com/test </section><!-- /#content --> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/pages/404.html b/pelican-plugins/i18n_subsites/test_data/output/pages/404.html index 05300a333a03a08388af46e8bb49a9a84598efa3..4695f3cd6f5188aa1f33ed75b6d5c53dc2c68280 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/pages/404.html +++ b/pelican-plugins/i18n_subsites/test_data/output/pages/404.html @@ -1,24 +1,31 @@ <!DOCTYPE html> <html lang="en"> <head> - <title>A 404 page</title> + <title>Testing site - A 404 page</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/theme/style.css" /> + + + <link rel="alternate" hreflang="cz" href="http://example.com/test/cz/pages/404.html"> + <link rel="alternate" hreflang="de" href="http://example.com/test/de/pages/404.html"> + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1> + <h1><a href="http://example.com/test/">Testing site</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> <li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li> + <li><a href="http://example.com/test/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <h1>A 404 page</h1> - Translations: -<a href="http://example.com/test/cz/pages/404.html">cz</a> -<a href="http://example.com/test/de/pages/404.html">de</a> + Translations: +<a href="http://example.com/test/cz/pages/404.html" hreflang="cz">cz</a> +<a href="http://example.com/test/de/pages/404.html" hreflang="de">de</a> <p>A simple 404 page.</p> @@ -26,8 +33,8 @@ <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/pages/untranslated-page.html b/pelican-plugins/i18n_subsites/test_data/output/pages/untranslated-page.html index d97f63456a823ec4c57f674f59b3f0e8561cf451..3ff02dfc6abede20e7697209dd9da84e48d78cd3 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/pages/untranslated-page.html +++ b/pelican-plugins/i18n_subsites/test_data/output/pages/untranslated-page.html @@ -1,19 +1,23 @@ <!DOCTYPE html> <html lang="en"> <head> - <title>Untranslated page</title> + <title>Testing site - Untranslated page</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/theme/style.css" /> + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1> + <h1><a href="http://example.com/test/">Testing site</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> <li class="active"><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li> + <li><a href="http://example.com/test/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <h1>Untranslated page</h1> @@ -23,8 +27,8 @@ <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_data/output/translated-article.html b/pelican-plugins/i18n_subsites/test_data/output/translated-article.html index 77188adc5067812aecc2544714ab7a5834dddfaa..45be1bb8cc4821f7eaf59ad2d18d9f72fb980bb0 100644 --- a/pelican-plugins/i18n_subsites/test_data/output/translated-article.html +++ b/pelican-plugins/i18n_subsites/test_data/output/translated-article.html @@ -1,31 +1,38 @@ <!DOCTYPE html> <html lang="en"> <head> - <title>Welcome to our Testing site</title> + <title>Testing site - A translated article</title> <meta charset="utf-8" /> + <meta name="generator" content="Pelican" /> <link href="http://example.com/test/feeds_all.atom.xml" type="application/atom+xml" rel="alternate" title="Testing site Full Atom Feed" /> <link rel="stylesheet" href="http://example.com/test/theme/style.css" /> + <link rel="alternate" hreflang="cz" href="http://example.com/test/cz/translated-article.html"> + <link rel="alternate" hreflang="de" href="http://example.com/test/de/translated-article.html"> + + + </head> <body id="index" class="home"> <header id="banner" class="body"> - <h1><a href="http://example.com/test/">Testing site <strong></strong></a></h1> + <h1><a href="http://example.com/test/">Testing site</a></h1> </header><!-- /#banner --> <nav id="menu"><ul> <li><a href="http://example.com/test/pages/untranslated-page.html">Untranslated page</a></li> + <li class="active"><a href="http://example.com/test/category/misc.html">misc</a></li> </ul></nav><!-- /#menu --> <section id="content" class="body"> <header> <h2 class="entry-title"> <a href="http://example.com/test/translated-article.html" rel="bookmark" title="Permalink to A translated article">A translated article</a></h2> - Translations: -<a href="http://example.com/test/cz/translated-article.html">cz</a> -<a href="http://example.com/test/de/translated-article.html">de</a> + Translations: +<a href="http://example.com/test/cz/translated-article.html" hreflang="cz">cz</a> +<a href="http://example.com/test/de/translated-article.html" hreflang="de">de</a> </header> <footer class="post-info"> @@ -35,6 +42,9 @@ <address class="vcard author"> By <a class="url fn" href="http://example.com/test/author/the-tester.html">The Tester</a> </address> + <div class="category"> + Category: <a href="http://example.com/test/category/misc.html">misc</a> + </div> </footer><!-- /.post-info --> <div class="entry-content"> <p>A simple article with a translation. @@ -44,8 +54,8 @@ Here is a link to <a class="reference external" href="http://example.com/test/im </section> <footer id="contentinfo" class="body"> <address id="about" class="vcard body"> - Proudly powered by <a href="http://getpelican.com/">Pelican</a>, - which takes great advantage of <a href="http://python.org">Python</a>. + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, + which takes great advantage of <a href="https://www.python.org/">Python</a>. </address><!-- /#about --> </footer><!-- /#contentinfo --> </body> diff --git a/pelican-plugins/i18n_subsites/test_i18n_subsites.py b/pelican-plugins/i18n_subsites/test_i18n_subsites.py index c6c1d6ac8a5e981a8c747578fe273797c13009fc..83d0cb986275e1f1ef18278b554bf0c41be0d2bb 100644 --- a/pelican-plugins/i18n_subsites/test_i18n_subsites.py +++ b/pelican-plugins/i18n_subsites/test_i18n_subsites.py @@ -136,4 +136,4 @@ class TestFullRun(unittest.TestCase): self.temp_path], env={'PAGER': ''}, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() self.assertFalse(out, 'non-empty `diff` stdout:\n{}'.format(out)) - self.assertFalse(err, 'non-empty `diff` stderr:\n{}'.format(out)) + self.assertFalse(err, 'non-empty `diff` stderr:\n{}'.format(err))