From dc20a4c244a817ee1da13d528e64ce2e7b10dc5e Mon Sep 17 00:00:00 2001
From: Luke Marlin <luke.marlin@viacesi.fr>
Date: Fri, 12 Mar 2021 00:36:21 +0100
Subject: [PATCH] Update i18n plugin

---
 .gitignore                                    |  1 -
 pelican-plugins/i18n_subsites/README.rst      |  9 ++++++
 .../i18n_subsites/i18n_subsites.py            | 22 +++++++++++----
 .../implementing_language_buttons.rst         |  2 +-
 .../i18n_subsites/localizing_using_jinja2.rst |  6 ++--
 .../output/an-untranslated-article.html       | 15 +++++++---
 .../output/cz/an-untranslated-article-en.html | 19 +++++++++----
 .../test_data/output/cz/feeds_all.atom.xml    | 26 ++++++-----------
 .../test_data/output/cz/index.html            | 12 ++++----
 .../test_data/output/cz/pages/404.html        | 23 +++++++++------
 .../output/cz/translated-article.html         | 26 +++++++++++------
 .../de/drafts/an-untranslated-article-en.html | 19 +++++++++----
 .../test_data/output/de/feeds_all.atom.xml    | 20 +++++--------
 .../test_data/output/de/index.html            | 12 ++++----
 .../test_data/output/de/pages/404.html        | 21 +++++++++-----
 .../output/de/pages/untranslated-page-en.html | 14 ++++++----
 .../output/de/translated-article.html         | 28 +++++++++++++------
 .../test_data/output/feeds_all.atom.xml       | 18 ++++--------
 .../i18n_subsites/test_data/output/index.html |  8 ++++--
 .../test_data/output/pages/404.html           | 21 +++++++++-----
 .../output/pages/untranslated-page.html       | 12 +++++---
 .../test_data/output/translated-article.html  | 24 +++++++++++-----
 .../i18n_subsites/test_i18n_subsites.py       |  2 +-
 23 files changed, 223 insertions(+), 137 deletions(-)

diff --git a/.gitignore b/.gitignore
index 2849524..b71f890 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 12e113d..340109b 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 388e758..dc27799 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 43f8bb3..55b7bf3 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 6ffe654..a28bedd 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 f45a103..f2f6494 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 1871ee6..4673ee5 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 e6797c2..7415e1f 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">&lt;p&gt;Jednoduchý článek s překlady.
-Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/cz/../images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
-Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/cz/../images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
-Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/cz/../images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
-Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/cz/../images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;A simple article with a translation.
-Here is a link to &lt;a class="reference external" href="http://example.com/test/cz/../images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;A simple article with a translation.
-Here is a link to &lt;a class="reference external" href="http://example.com/test/cz/../images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;An article without a translation.
-Here is a link to an &lt;a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;An article without a translation.
-Here is a link to an &lt;a class="reference external" href="http://example.com/test/cz/../pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
-</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">&lt;p&gt;Jednoduchý článek s překlady.
+Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
+</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">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
+Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
+</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">&lt;p&gt;A simple article with a translation.
+Here is a link to &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
+</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">&lt;p&gt;An article without a translation.
+Here is a link to an &lt;a class="reference external" href="http://example.com/test/pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
+</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 08dce15..c5fca32 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 c6e659d..884203b 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 9402c9a..5a5e545 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 e58078f..f01dc31 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 b5f596b..8d845fe 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">&lt;p&gt;Jednoduchý článek s překlady.
-Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/de/../images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
-Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/de/../images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
-Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/de/../images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
-Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/de/../images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;A simple article with a translation.
-Here is a link to &lt;a class="reference external" href="http://example.com/test/de/../images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;A simple article with a translation.
-Here is a link to &lt;a class="reference external" href="http://example.com/test/de/../images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;Jednoduchý článek s překlady.
+Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
+</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">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
+Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
+</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">&lt;p&gt;A simple article with a translation.
+Here is a link to &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
+</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 8dee6a7..fc43ae1 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 b1721f5..6425660 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 9873cbd..2df5ff9 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 bd26a83..9393b95 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 609cf99..c6c0908 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">&lt;p&gt;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">&lt;p&gt;Jednoduchý článek s překlady.
 Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;Jednoduchý článek s překlady.
-Zde je odkaz na &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;nějaký obrázek&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
-Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;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">&lt;p&gt;Ein einfacher Artikel mit einer Übersetzung.
 Hier ist ein Link zur &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;einigem Bild&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;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">&lt;p&gt;A simple article with a translation.
 Here is a link to &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;A simple article with a translation.
-Here is a link to &lt;a class="reference external" href="http://example.com/test/images/img.png"&gt;some image&lt;/a&gt;.&lt;/p&gt;
-</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">&lt;p&gt;An article without a translation.
-Here is a link to an &lt;a class="reference external" href="http://example.com/test/pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
-</summary><content type="html">&lt;p&gt;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">&lt;p&gt;An article without a translation.
 Here is a link to an &lt;a class="reference external" href="http://example.com/test/pages/untranslated-page.html"&gt;untranslated page&lt;/a&gt;&lt;/p&gt;
-</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 5779f4f..c455687 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 05300a3..4695f3c 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 d97f634..3ff02df 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 77188ad..45be1bb 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 c6c1d6a..83d0cb9 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))
-- 
GitLab