diff --git a/docs/contribute.rst b/docs/contribute.rst
index 57349156..044ef924 100644
--- a/docs/contribute.rst
+++ b/docs/contribute.rst
@@ -90,6 +90,8 @@ functional tests. To do so, you can use the following two commands::
$ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \
-s samples/pelican.conf.py samples/content/
+ $ LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \
+ -s samples/pelican_FR.conf.py samples/content/
$ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \
samples/content/
diff --git a/pelican/contents.py b/pelican/contents.py
index 220db611..297a537b 100644
--- a/pelican/contents.py
+++ b/pelican/contents.py
@@ -11,13 +11,12 @@ import os
import re
import sys
-from datetime import datetime
from pelican import signals
from pelican.settings import DEFAULT_CONFIG
from pelican.utils import (slugify, truncate_html_words, memoized, strftime,
python_2_unicode_compatible, deprecated_attribute,
- path_to_url)
+ path_to_url, SafeDatetime)
# Import these so that they're avalaible when you import from pelican.contents.
from pelican.urlwrappers import (URLWrapper, Author, Category, Tag) # NOQA
@@ -127,7 +126,7 @@ class Content(object):
if not hasattr(self, 'status'):
self.status = settings['DEFAULT_STATUS']
if not settings['WITH_FUTURE_DATES']:
- if hasattr(self, 'date') and self.date > datetime.now():
+ if hasattr(self, 'date') and self.date > SafeDatetime.now():
self.status = 'draft'
# store the summary metadata if it is set
@@ -161,7 +160,7 @@ class Content(object):
'path': path_to_url(path),
'slug': getattr(self, 'slug', ''),
'lang': getattr(self, 'lang', 'en'),
- 'date': getattr(self, 'date', datetime.now()),
+ 'date': getattr(self, 'date', SafeDatetime.now()),
'author': slugify(
getattr(self, 'author', ''),
slug_substitutions
diff --git a/pelican/generators.py b/pelican/generators.py
index deb237a2..865cc6f8 100644
--- a/pelican/generators.py
+++ b/pelican/generators.py
@@ -2,6 +2,7 @@
from __future__ import unicode_literals, print_function
import os
+import six
import math
import random
import logging
@@ -348,31 +349,22 @@ class ArticlesGenerator(CachingGenerator):
# format string syntax can be used for specifying the
# period archive dates
date = archive[0].date
- # Under python 2, with non-ascii locales, u"{:%b}".format(date) might raise UnicodeDecodeError
- # because u"{:%b}".format(date) will call date.__format__(u"%b"), which will return a byte string
- # and not a unicode string.
- # eg:
- # locale.setlocale(locale.LC_ALL, 'ja_JP.utf8')
- # date.__format__(u"%b") == '12\xe6\x9c\x88' # True
- try:
- save_as = save_as_fmt.format(date=date)
- except UnicodeDecodeError:
- # Python2 only:
- # Let date.__format__() work with byte strings instead of characters since it fails to work with characters
- bytes_save_as_fmt = save_as_fmt.encode('utf8')
- bytes_save_as = bytes_save_as_fmt.format(date=date)
- save_as = unicode(bytes_save_as,'utf8')
+ save_as = save_as_fmt.format(date=date)
context = self.context.copy()
if key == period_date_key['year']:
context["period"] = (_period,)
- elif key == period_date_key['month']:
- context["period"] = (_period[0],
- calendar.month_name[_period[1]])
else:
- context["period"] = (_period[0],
- calendar.month_name[_period[1]],
- _period[2])
+ month_name = calendar.month_name[_period[1]]
+ if not six.PY3:
+ month_name = month_name.decode('utf-8')
+ if key == period_date_key['month']:
+ context["period"] = (_period[0],
+ month_name)
+ else:
+ context["period"] = (_period[0],
+ month_name,
+ _period[2])
write(save_as, template, context,
dates=archive, blog=True)
diff --git a/pelican/readers.py b/pelican/readers.py
index 431e6937..e977b349 100644
--- a/pelican/readers.py
+++ b/pelican/readers.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
-import datetime
import logging
import os
import re
@@ -28,7 +27,7 @@ except ImportError:
from pelican import signals
from pelican.contents import Page, Category, Tag, Author
-from pelican.utils import get_date, pelican_open, FileStampDataCacher
+from pelican.utils import get_date, pelican_open, FileStampDataCacher, SafeDatetime
METADATA_PROCESSORS = {
@@ -494,7 +493,7 @@ def default_metadata(settings=None, process=None):
value = process('category', value)
metadata['category'] = value
if settings.get('DEFAULT_DATE', None) and settings['DEFAULT_DATE'] != 'fs':
- metadata['date'] = datetime.datetime(*settings['DEFAULT_DATE'])
+ metadata['date'] = SafeDatetime(*settings['DEFAULT_DATE'])
return metadata
@@ -502,7 +501,7 @@ def path_metadata(full_path, source_path, settings=None):
metadata = {}
if settings:
if settings.get('DEFAULT_DATE', None) == 'fs':
- metadata['date'] = datetime.datetime.fromtimestamp(
+ metadata['date'] = SafeDatetime.fromtimestamp(
os.stat(full_path).st_ctime)
metadata.update(settings.get('EXTRA_PATH_METADATA', {}).get(
source_path, {}))
@@ -525,7 +524,7 @@ def parse_path_metadata(source_path, settings=None, process=None):
... process=reader.process_metadata)
>>> pprint.pprint(metadata) # doctest: +ELLIPSIS
{'category': ,
- 'date': datetime.datetime(2013, 1, 1, 0, 0),
+ 'date': SafeDatetime(2013, 1, 1, 0, 0),
'slug': 'my-slug'}
"""
metadata = {}
diff --git a/pelican/tests/output/custom_locale/archives.html b/pelican/tests/output/custom_locale/archives.html
new file mode 100644
index 00000000..a7b96336
--- /dev/null
+++ b/pelican/tests/output/custom_locale/archives.html
@@ -0,0 +1,100 @@
+
+
+
+
+ Alexis' log
+
+
+
+
+
+
+
+
+
+
+
+
+
+Archives for Alexis' log
+
+
+ ven. 30 novembre 2012
+ FILENAME_METADATA example
+ mer. 29 février 2012
+ Second article
+ mer. 20 avril 2011
+ A markdown powered article
+ jeu. 17 février 2011
+ Article 1
+ jeu. 17 février 2011
+ Article 2
+ jeu. 17 février 2011
+ Article 3
+ jeu. 02 décembre 2010
+ This is a super article !
+ mer. 20 octobre 2010
+ Oh yeah !
+ ven. 15 octobre 2010
+ Unbelievable !
+ dim. 14 mars 2010
+ The baz tag
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau.html b/pelican/tests/output/custom_locale/author/alexis-metaireau.html
new file mode 100644
index 00000000..b54446c8
--- /dev/null
+++ b/pelican/tests/output/custom_locale/author/alexis-metaireau.html
@@ -0,0 +1,173 @@
+
+
+
+
+ Alexis' log - Alexis Métaireau
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 30 novembre 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Some cool stuff!
+There are comments .
+
+
+ Other articles
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ fr
+
+ This is some article, in english
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 1
+
+
read more
+
There are comments .
+
+
+
+ Page 1 / 3
+ »
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau2.html b/pelican/tests/output/custom_locale/author/alexis-metaireau2.html
new file mode 100644
index 00000000..07020512
--- /dev/null
+++ b/pelican/tests/output/custom_locale/author/alexis-metaireau2.html
@@ -0,0 +1,187 @@
+
+
+
+
+ Alexis' log - Alexis Métaireau
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 2
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 3
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Multi-line metadata should be supported
+as well as inline markup .
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: mer. 20 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In bar .
+tags: oh bar yeah
Translations:
+ fr
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+
+
+
+
read more
+
There are comments .
+
+
+
+ «
+ Page 2 / 3
+ »
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html
new file mode 100644
index 00000000..9578e3d6
--- /dev/null
+++ b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html
@@ -0,0 +1,138 @@
+
+
+
+
+ Alexis' log - Alexis Métaireau
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 15 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Or completely awesome. Depends the needs.
+
a root-relative link to markdown-article
+a file-relative link to markdown-article
+
+
Testing sourcecode directive
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
+
+
+
Testing another case
+
This will now have a line number in 'custom' since it's the default in
+pelican.conf, it ...
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: dim. 14 mars 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ This article overrides the listening of the articles under the baz tag.
+
+
read more
+
There are comments .
+
+
+
+ «
+ Page 3 / 3
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/authors.html b/pelican/tests/output/custom_locale/authors.html
new file mode 100644
index 00000000..2558c4d8
--- /dev/null
+++ b/pelican/tests/output/custom_locale/authors.html
@@ -0,0 +1,82 @@
+
+
+
+
+ Alexis' log - Authors
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Authors on Alexis' log
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/categories.html b/pelican/tests/output/custom_locale/categories.html
new file mode 100644
index 00000000..17d9de76
--- /dev/null
+++ b/pelican/tests/output/custom_locale/categories.html
@@ -0,0 +1,80 @@
+
+
+
+
+ Alexis' log
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/category/bar.html b/pelican/tests/output/custom_locale/category/bar.html
new file mode 100644
index 00000000..d9fc6acb
--- /dev/null
+++ b/pelican/tests/output/custom_locale/category/bar.html
@@ -0,0 +1,101 @@
+
+
+
+
+ Alexis' log - bar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 20 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In bar .
+tags: oh bar yeah
Translations:
+ fr
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+
+
+There are comments .
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/category/cat1.html b/pelican/tests/output/custom_locale/category/cat1.html
new file mode 100644
index 00000000..1b09acfe
--- /dev/null
+++ b/pelican/tests/output/custom_locale/category/cat1.html
@@ -0,0 +1,170 @@
+
+
+
+
+ Alexis' log - cat1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 20 avril 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ You're mutually oblivious.
+a root-relative link to unbelievable
+a file-relative link to unbelievable
There are comments .
+
+
+ Other articles
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 1
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 2
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 3
+
+
read more
+
There are comments .
+
+
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/category/misc.html b/pelican/tests/output/custom_locale/category/misc.html
new file mode 100644
index 00000000..bcaec248
--- /dev/null
+++ b/pelican/tests/output/custom_locale/category/misc.html
@@ -0,0 +1,181 @@
+
+
+
+
+ Alexis' log - misc
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 30 novembre 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Some cool stuff!
+There are comments .
+
+
+ Other articles
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ fr
+
+ This is some article, in english
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: ven. 15 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Or completely awesome. Depends the needs.
+
a root-relative link to markdown-article
+a file-relative link to markdown-article
+
+
Testing sourcecode directive
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
+
+
+
Testing another case
+
This will now have a line number in 'custom' since it's the default in
+pelican.conf, it ...
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: dim. 14 mars 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ This article overrides the listening of the articles under the baz tag.
+
+
read more
+
There are comments .
+
+
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/category/yeah.html b/pelican/tests/output/custom_locale/category/yeah.html
new file mode 100644
index 00000000..7f881612
--- /dev/null
+++ b/pelican/tests/output/custom_locale/category/yeah.html
@@ -0,0 +1,109 @@
+
+
+
+
+ Alexis' log - yeah
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Some content here !
+
+
This is a simple title
+
And here comes the cool stuff .
+
+
+
+>>> from ipdb import set_trace
+>>> set_trace()
+
+
→ And now try with some utf8 hell: ééé
+
+There are comments .
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article.html b/pelican/tests/output/custom_locale/drafts/a-draft-article.html
new file mode 100644
index 00000000..82fb057b
--- /dev/null
+++ b/pelican/tests/output/custom_locale/drafts/a-draft-article.html
@@ -0,0 +1,100 @@
+
+
+
+
+ A draft article
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 02 mars 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ This is a draft article, it should live under the /drafts/ folder and not be
+listed anywhere else.
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml
new file mode 100644
index 00000000..202b9f71
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml
@@ -0,0 +1,61 @@
+
+Alexis' log http://blog.notmyidea.org/ 2013-11-17T23:29:00+01:00 FILENAME_METADATA example 2012-11-30T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ <p>Some cool stuff!</p>
+ Second article 2012-02-29T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ <p>This is some article, in english</p>
+ A markdown powered article 2011-04-20T00:00:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ <p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Article 1 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ <p>Article 1</p>
+ Article 2 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ <p>Article 2</p>
+ Article 3 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ <p>Article 3</p>
+ This is a super article ! 2013-11-17T23:29:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ <p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+ Oh yeah ! 2010-10-20T10:14:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ <div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+ Unbelievable ! 2010-10-15T20:30:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ <p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ The baz tag 2010-03-14T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-03-14:tag/baz.html <p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml
new file mode 100644
index 00000000..dfb83630
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml
@@ -0,0 +1,61 @@
+
+Alexis' log http://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100 FILENAME_METADATA example http://blog.notmyidea.org/posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p>
+ Alexis Métaireau Fri, 30 Nov 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ Second article http://blog.notmyidea.org/posts/2012/February/29/second-article/<p>This is some article, in english</p>
+ Alexis Métaireau Wed, 29 Feb 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ foo bar baz A markdown powered article http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Alexis Métaireau Wed, 20 Apr 2011 00:00:00 +0200 tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ Article 1 http://blog.notmyidea.org/posts/2011/February/17/article-1/<p>Article 1</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ Article 2 http://blog.notmyidea.org/posts/2011/February/17/article-2/<p>Article 2</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ Article 3 http://blog.notmyidea.org/posts/2011/February/17/article-3/<p>Article 3</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ This is a super article ! http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+ Alexis Métaireau Sun, 17 Nov 2013 23:29:00 +0100 tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ foo bar foobar Oh yeah ! http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/<div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+ Alexis Métaireau Wed, 20 Oct 2010 10:14:00 +0200 tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ oh bar yeah Unbelievable ! http://blog.notmyidea.org/posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ Alexis Métaireau Fri, 15 Oct 2010 20:30:00 +0200 tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ The baz tag http://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+ Alexis Métaireau Sun, 14 Mar 2010 00:00:00 +0100 tag:blog.notmyidea.org,2010-03-14:tag/baz.html
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/all-en.atom.xml b/pelican/tests/output/custom_locale/feeds/all-en.atom.xml
new file mode 100644
index 00000000..3bb10e38
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/all-en.atom.xml
@@ -0,0 +1,61 @@
+
+Alexis' log http://blog.notmyidea.org/ 2013-11-17T23:29:00+01:00 FILENAME_METADATA example 2012-11-30T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ <p>Some cool stuff!</p>
+ Second article 2012-02-29T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ <p>This is some article, in english</p>
+ A markdown powered article 2011-04-20T00:00:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ <p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Article 1 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ <p>Article 1</p>
+ Article 2 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ <p>Article 2</p>
+ Article 3 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ <p>Article 3</p>
+ This is a super article ! 2013-11-17T23:29:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ <p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+ Oh yeah ! 2010-10-20T10:14:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ <div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+ Unbelievable ! 2010-10-15T20:30:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ <p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ The baz tag 2010-03-14T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-03-14:tag/baz.html <p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml b/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml
new file mode 100644
index 00000000..5d58742c
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml
@@ -0,0 +1,4 @@
+
+Alexis' log http://blog.notmyidea.org/ 2012-03-02T14:01:01+01:00 Trop bien ! 2012-03-02T14:01:01+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html <p>Et voila du contenu en français</p>
+ Deuxième article 2012-02-29T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-02-29:second-article-fr.html <p>Ceci est un article, en français.</p>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/all.atom.xml b/pelican/tests/output/custom_locale/feeds/all.atom.xml
new file mode 100644
index 00000000..f709f2b1
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/all.atom.xml
@@ -0,0 +1,63 @@
+
+Alexis' log http://blog.notmyidea.org/ 2013-11-17T23:29:00+01:00 FILENAME_METADATA example 2012-11-30T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ <p>Some cool stuff!</p>
+ Trop bien ! 2012-03-02T14:01:01+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html <p>Et voila du contenu en français</p>
+ Second article 2012-02-29T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ <p>This is some article, in english</p>
+ Deuxième article 2012-02-29T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-02-29:second-article-fr.html <p>Ceci est un article, en français.</p>
+ A markdown powered article 2011-04-20T00:00:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ <p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Article 1 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ <p>Article 1</p>
+ Article 2 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ <p>Article 2</p>
+ Article 3 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ <p>Article 3</p>
+ This is a super article ! 2013-11-17T23:29:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ <p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+ Oh yeah ! 2010-10-20T10:14:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ <div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+ Unbelievable ! 2010-10-15T20:30:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ <p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ The baz tag 2010-03-14T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-03-14:tag/baz.html <p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/all.rss.xml b/pelican/tests/output/custom_locale/feeds/all.rss.xml
new file mode 100644
index 00000000..39fbc240
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/all.rss.xml
@@ -0,0 +1,63 @@
+
+Alexis' log http://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100 FILENAME_METADATA example http://blog.notmyidea.org/posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p>
+ Alexis Métaireau Fri, 30 Nov 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ Trop bien ! http://blog.notmyidea.org/oh-yeah-fr.html<p>Et voila du contenu en français</p>
+ Alexis Métaireau Fri, 02 Mar 2012 14:01:01 +0100 tag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html Second article http://blog.notmyidea.org/posts/2012/February/29/second-article/<p>This is some article, in english</p>
+ Alexis Métaireau Wed, 29 Feb 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ foo bar baz Deuxième article http://blog.notmyidea.org/second-article-fr.html<p>Ceci est un article, en français.</p>
+ Alexis Métaireau Wed, 29 Feb 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-02-29:second-article-fr.html foo bar baz A markdown powered article http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Alexis Métaireau Wed, 20 Apr 2011 00:00:00 +0200 tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ Article 1 http://blog.notmyidea.org/posts/2011/February/17/article-1/<p>Article 1</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ Article 2 http://blog.notmyidea.org/posts/2011/February/17/article-2/<p>Article 2</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ Article 3 http://blog.notmyidea.org/posts/2011/February/17/article-3/<p>Article 3</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ This is a super article ! http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+ Alexis Métaireau Sun, 17 Nov 2013 23:29:00 +0100 tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ foo bar foobar Oh yeah ! http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/<div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+ Alexis Métaireau Wed, 20 Oct 2010 10:14:00 +0200 tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ oh bar yeah Unbelievable ! http://blog.notmyidea.org/posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ Alexis Métaireau Fri, 15 Oct 2010 20:30:00 +0200 tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ The baz tag http://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+ Alexis Métaireau Sun, 14 Mar 2010 00:00:00 +0100 tag:blog.notmyidea.org,2010-03-14:tag/baz.html
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/bar.atom.xml b/pelican/tests/output/custom_locale/feeds/bar.atom.xml
new file mode 100644
index 00000000..13a5cde2
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/bar.atom.xml
@@ -0,0 +1,8 @@
+
+Alexis' log http://blog.notmyidea.org/ 2010-10-20T10:14:00+02:00 Oh yeah ! 2010-10-20T10:14:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ <div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/bar.rss.xml b/pelican/tests/output/custom_locale/feeds/bar.rss.xml
new file mode 100644
index 00000000..4426eb6a
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/bar.rss.xml
@@ -0,0 +1,8 @@
+
+Alexis' log http://blog.notmyidea.org/Wed, 20 Oct 2010 10:14:00 +0200 Oh yeah ! http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/<div class="section" id="why-not">
+<h2>Why not ?</h2>
+<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+</div>
+ Alexis Métaireau Wed, 20 Oct 2010 10:14:00 +0200 tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ oh bar yeah
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/cat1.atom.xml b/pelican/tests/output/custom_locale/feeds/cat1.atom.xml
new file mode 100644
index 00000000..54d382c4
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/cat1.atom.xml
@@ -0,0 +1,7 @@
+
+Alexis' log http://blog.notmyidea.org/ 2011-04-20T00:00:00+02:00 A markdown powered article 2011-04-20T00:00:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ <p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Article 1 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ <p>Article 1</p>
+ Article 2 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ <p>Article 2</p>
+ Article 3 2011-02-17T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ <p>Article 3</p>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/cat1.rss.xml b/pelican/tests/output/custom_locale/feeds/cat1.rss.xml
new file mode 100644
index 00000000..4f3b12f5
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/cat1.rss.xml
@@ -0,0 +1,7 @@
+
+Alexis' log http://blog.notmyidea.org/Wed, 20 Apr 2011 00:00:00 +0200 A markdown powered article http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p>
+<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a>
+<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p> Alexis Métaireau Wed, 20 Apr 2011 00:00:00 +0200 tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/ Article 1 http://blog.notmyidea.org/posts/2011/February/17/article-1/<p>Article 1</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/ Article 2 http://blog.notmyidea.org/posts/2011/February/17/article-2/<p>Article 2</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/ Article 3 http://blog.notmyidea.org/posts/2011/February/17/article-3/<p>Article 3</p>
+ Alexis Métaireau Thu, 17 Feb 2011 00:00:00 +0100 tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/misc.atom.xml b/pelican/tests/output/custom_locale/feeds/misc.atom.xml
new file mode 100644
index 00000000..18800485
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/misc.atom.xml
@@ -0,0 +1,38 @@
+
+Alexis' log http://blog.notmyidea.org/ 2012-11-30T00:00:00+01:00 FILENAME_METADATA example 2012-11-30T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ <p>Some cool stuff!</p>
+ Second article 2012-02-29T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ <p>This is some article, in english</p>
+ Unbelievable ! 2010-10-15T20:30:00+02:00 Alexis Métaireau tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ <p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ The baz tag 2010-03-14T00:00:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-03-14:tag/baz.html <p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/misc.rss.xml b/pelican/tests/output/custom_locale/feeds/misc.rss.xml
new file mode 100644
index 00000000..0be49f79
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/misc.rss.xml
@@ -0,0 +1,38 @@
+
+Alexis' log http://blog.notmyidea.org/Fri, 30 Nov 2012 00:00:00 +0100 FILENAME_METADATA example http://blog.notmyidea.org/posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p>
+ Alexis Métaireau Fri, 30 Nov 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/ Second article http://blog.notmyidea.org/posts/2012/February/29/second-article/<p>This is some article, in english</p>
+ Alexis Métaireau Wed, 29 Feb 2012 00:00:00 +0100 tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/ foo bar baz Unbelievable ! http://blog.notmyidea.org/posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p>
+<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a>
+<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p>
+<div class="section" id="testing-sourcecode-directive">
+<h2>Testing sourcecode directive</h2>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table></div>
+<div class="section" id="testing-another-case">
+<h2>Testing another case</h2>
+<p>This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.</p>
+<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+</td></tr></table><p>Lovely.</p>
+</div>
+<div class="section" id="testing-more-sourcecode-directives">
+<h2>Testing more sourcecode directives</h2>
+<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">'linenos'</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'table'</span><span class="testingp">,</span> <span class="testings">'inline'</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">'linenos'</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">'table'</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">'nowrap'</span><span class="testingp">,</span> <span class="testings">'nobackground'</span><span class="testingp">,</span> <span class="testings">'anchorlinenos'</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">'</span><span class="testingse">\n</span><span class="testings">'</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">''</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">'html'</span><span class="testingp">)]</span><br></span></pre></div>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-even-more-sourcecode-directives">
+<h2>Testing even more sourcecode directives</h2>
+<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+<p>Lovely.</p>
+</div>
+<div class="section" id="testing-overriding-config-defaults">
+<h2>Testing overriding config defaults</h2>
+<p>Even if the default is line numbers, we can override it here</p>
+<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span>
+</pre></div>
+<p>Lovely.</p>
+</div>
+ Alexis Métaireau Fri, 15 Oct 2010 20:30:00 +0200 tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/ The baz tag http://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p>
+ Alexis Métaireau Sun, 14 Mar 2010 00:00:00 +0100 tag:blog.notmyidea.org,2010-03-14:tag/baz.html
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/yeah.atom.xml b/pelican/tests/output/custom_locale/feeds/yeah.atom.xml
new file mode 100644
index 00000000..5f7d8c4f
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/yeah.atom.xml
@@ -0,0 +1,14 @@
+
+Alexis' log http://blog.notmyidea.org/ 2013-11-17T23:29:00+01:00 This is a super article ! 2013-11-17T23:29:00+01:00 Alexis Métaireau tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ <p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/feeds/yeah.rss.xml b/pelican/tests/output/custom_locale/feeds/yeah.rss.xml
new file mode 100644
index 00000000..50c5803c
--- /dev/null
+++ b/pelican/tests/output/custom_locale/feeds/yeah.rss.xml
@@ -0,0 +1,14 @@
+
+Alexis' log http://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100 This is a super article ! http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p>
+<div class="section" id="this-is-a-simple-title">
+<h2>This is a simple title</h2>
+<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p>
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" />
+<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" />
+<pre class="literal-block">
+>>> from ipdb import set_trace
+>>> set_trace()
+</pre>
+<p>→ And now try with some utf8 hell: ééé</p>
+</div>
+ Alexis Métaireau Sun, 17 Nov 2013 23:29:00 +0100 tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/ foo bar foobar
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/index.html b/pelican/tests/output/custom_locale/index.html
new file mode 100644
index 00000000..fd9a82b4
--- /dev/null
+++ b/pelican/tests/output/custom_locale/index.html
@@ -0,0 +1,173 @@
+
+
+
+
+ Alexis' log
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 30 novembre 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Some cool stuff!
+There are comments .
+
+
+ Other articles
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ fr
+
+ This is some article, in english
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 1
+
+
read more
+
There are comments .
+
+
+
+ Page 1 / 3
+ »
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/index2.html b/pelican/tests/output/custom_locale/index2.html
new file mode 100644
index 00000000..f02ba27c
--- /dev/null
+++ b/pelican/tests/output/custom_locale/index2.html
@@ -0,0 +1,187 @@
+
+
+
+
+ Alexis' log
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 2
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 3
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Multi-line metadata should be supported
+as well as inline markup .
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: mer. 20 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In bar .
+tags: oh bar yeah
Translations:
+ fr
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+
+
+
+
read more
+
There are comments .
+
+
+
+ «
+ Page 2 / 3
+ »
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/index3.html b/pelican/tests/output/custom_locale/index3.html
new file mode 100644
index 00000000..9c7416b6
--- /dev/null
+++ b/pelican/tests/output/custom_locale/index3.html
@@ -0,0 +1,138 @@
+
+
+
+
+ Alexis' log
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 15 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Or completely awesome. Depends the needs.
+
a root-relative link to markdown-article
+a file-relative link to markdown-article
+
+
Testing sourcecode directive
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
+
+
+
Testing another case
+
This will now have a line number in 'custom' since it's the default in
+pelican.conf, it ...
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: dim. 14 mars 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ This article overrides the listening of the articles under the baz tag.
+
+
read more
+
There are comments .
+
+
+
+ «
+ Page 3 / 3
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/jinja2_template.html b/pelican/tests/output/custom_locale/jinja2_template.html
new file mode 100644
index 00000000..0eafa913
--- /dev/null
+++ b/pelican/tests/output/custom_locale/jinja2_template.html
@@ -0,0 +1,77 @@
+
+
+
+
+ Alexis' log
+
+
+
+
+
+
+
+
+
+
+
+
+
+Some text
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/oh-yeah-fr.html b/pelican/tests/output/custom_locale/oh-yeah-fr.html
new file mode 100644
index 00000000..cdda855d
--- /dev/null
+++ b/pelican/tests/output/custom_locale/oh-yeah-fr.html
@@ -0,0 +1,116 @@
+
+
+
+
+ Trop bien !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 02 mars 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+Translations:
+ en
+
+ Et voila du contenu en français
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/override/index.html b/pelican/tests/output/custom_locale/override/index.html
new file mode 100644
index 00000000..e84d79fe
--- /dev/null
+++ b/pelican/tests/output/custom_locale/override/index.html
@@ -0,0 +1,81 @@
+
+
+
+
+ Override url/save_as
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Override url/save_as
+
+ Test page which overrides save_as and url so that this page will be generated
+at a custom location.
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html
new file mode 100644
index 00000000..dced8107
--- /dev/null
+++ b/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html
@@ -0,0 +1,81 @@
+
+
+
+
+ This is a test hidden page
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is a test hidden page
+
+ This is great for things like error(404) pages
+Anyone can see this page but it's not linked to anywhere!
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html b/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html
new file mode 100644
index 00000000..46ea4fef
--- /dev/null
+++ b/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html
@@ -0,0 +1,81 @@
+
+
+
+
+ This is a test page
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is a test page
+
+ Just an image.
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/pictures/Fat_Cat.jpg b/pelican/tests/output/custom_locale/pictures/Fat_Cat.jpg
new file mode 100644
index 00000000..d8a96d35
Binary files /dev/null and b/pelican/tests/output/custom_locale/pictures/Fat_Cat.jpg differ
diff --git a/pelican/tests/output/custom_locale/pictures/Sushi.jpg b/pelican/tests/output/custom_locale/pictures/Sushi.jpg
new file mode 100644
index 00000000..e49e5f0a
Binary files /dev/null and b/pelican/tests/output/custom_locale/pictures/Sushi.jpg differ
diff --git a/pelican/tests/output/custom_locale/pictures/Sushi_Macro.jpg b/pelican/tests/output/custom_locale/pictures/Sushi_Macro.jpg
new file mode 100644
index 00000000..21f935a1
Binary files /dev/null and b/pelican/tests/output/custom_locale/pictures/Sushi_Macro.jpg differ
diff --git a/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html
new file mode 100644
index 00000000..ec1007f3
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html
@@ -0,0 +1,129 @@
+
+
+
+
+ This is a super article !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Some content here !
+
+
This is a simple title
+
And here comes the cool stuff .
+
+
+
+>>> from ipdb import set_trace
+>>> set_trace()
+
+
→ And now try with some utf8 hell: ééé
+
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html
new file mode 100644
index 00000000..cb8ccef5
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html
@@ -0,0 +1,146 @@
+
+
+
+
+ Unbelievable !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 15 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Or completely awesome. Depends the needs.
+
a root-relative link to markdown-article
+a file-relative link to markdown-article
+
+
Testing sourcecode directive
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
+
+
+
Testing another case
+
This will now have a line number in 'custom' since it's the default in
+pelican.conf, it will have nothing in default.
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
+
Lovely.
+
+
+
Testing more sourcecode directives
+
8 def run ( self ): self . assert_has_content () 10 try : lexer = get_lexer_by_name ( self . arguments [ 0 ]) 12 except ValueError : # no lexer found - use the text one instead of an exception 14 lexer = TextLexer () 16 if ( 'linenos' in self . options and self . options [ 'linenos' ] not in ( 'table' , 'inline' )): 18 self . options [ 'linenos' ] = 'table' 20 for flag in ( 'nowrap' , 'nobackground' , 'anchorlinenos' ): if flag in self . options : 22 self . options [ flag ] = True 24 # noclasses should already default to False, but just in case... formatter = HtmlFormatter ( noclasses = False , ** self . options ) 26 parsed = highlight ( ' \n ' . join ( self . content ), lexer , formatter ) return [ nodes . raw ( '' , parsed , format = 'html' )]
+
Lovely.
+
+
+
Testing even more sourcecode directives
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
Lovely.
+
+
+
Testing overriding config defaults
+
Even if the default is line numbers, we can override it here
+
formatter = self . options and VARIANTS [ self . options . keys ()[ 0 ]]
+
+
Lovely.
+
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html
new file mode 100644
index 00000000..c42bce5d
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html
@@ -0,0 +1,121 @@
+
+
+
+
+ Oh yeah !
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 20 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In bar .
+tags: oh bar yeah
Translations:
+ fr
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+
+
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html
new file mode 100644
index 00000000..49cc6078
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html
@@ -0,0 +1,115 @@
+
+
+
+
+ A markdown powered article
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 20 avril 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ You're mutually oblivious.
+
a root-relative link to unbelievable
+a file-relative link to unbelievable
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html
new file mode 100644
index 00000000..8029e585
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html
@@ -0,0 +1,114 @@
+
+
+
+
+ Article 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 1
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html
new file mode 100644
index 00000000..ca6aaaf3
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html
@@ -0,0 +1,114 @@
+
+
+
+
+ Article 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 2
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html
new file mode 100644
index 00000000..4f255f4f
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html
@@ -0,0 +1,114 @@
+
+
+
+
+ Article 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 17 février 2011
+
+
+
+ By Alexis Métaireau
+
+In cat1 .
+
+ Article 3
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html
new file mode 100644
index 00000000..46b07717
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html
@@ -0,0 +1,116 @@
+
+
+
+
+ Second article
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ fr
+
+ This is some article, in english
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html
new file mode 100644
index 00000000..0d021cde
--- /dev/null
+++ b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html
@@ -0,0 +1,114 @@
+
+
+
+
+ FILENAME_METADATA example
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: ven. 30 novembre 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ Some cool stuff!
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/robots.txt b/pelican/tests/output/custom_locale/robots.txt
new file mode 100644
index 00000000..19a6e299
--- /dev/null
+++ b/pelican/tests/output/custom_locale/robots.txt
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /pictures
diff --git a/pelican/tests/output/custom_locale/second-article-fr.html b/pelican/tests/output/custom_locale/second-article-fr.html
new file mode 100644
index 00000000..2798c94b
--- /dev/null
+++ b/pelican/tests/output/custom_locale/second-article-fr.html
@@ -0,0 +1,116 @@
+
+
+
+
+ Deuxième article
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ en
+
+ Ceci est un article, en français.
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tag/bar.html b/pelican/tests/output/custom_locale/tag/bar.html
new file mode 100644
index 00000000..8a65a834
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tag/bar.html
@@ -0,0 +1,160 @@
+
+
+
+
+ Alexis' log - bar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ fr
+
+ This is some article, in english
+There are comments .
+
+
+ Other articles
+
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Multi-line metadata should be supported
+as well as inline markup .
+
+
read more
+
There are comments .
+
+
+
+
+
+
+
+
+ Published: mer. 20 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In bar .
+tags: oh bar yeah
Translations:
+ fr
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+
+
+
+
read more
+
There are comments .
+
+
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tag/baz.html b/pelican/tests/output/custom_locale/tag/baz.html
new file mode 100644
index 00000000..52467abb
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tag/baz.html
@@ -0,0 +1,114 @@
+
+
+
+
+ The baz tag
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: dim. 14 mars 2010
+
+
+
+ By Alexis Métaireau
+
+In misc .
+
+ This article overrides the listening of the articles under the baz tag.
+
+
+
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tag/foo.html b/pelican/tests/output/custom_locale/tag/foo.html
new file mode 100644
index 00000000..87cb4ec5
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tag/foo.html
@@ -0,0 +1,130 @@
+
+
+
+
+ Alexis' log - foo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 29 février 2012
+
+
+
+ By Alexis Métaireau
+
+In misc .
+tags: foo bar baz
Translations:
+ fr
+
+ This is some article, in english
+There are comments .
+
+
+ Other articles
+
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Multi-line metadata should be supported
+as well as inline markup .
+
+
read more
+
There are comments .
+
+
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tag/foobar.html b/pelican/tests/output/custom_locale/tag/foobar.html
new file mode 100644
index 00000000..0e5414b0
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tag/foobar.html
@@ -0,0 +1,109 @@
+
+
+
+
+ Alexis' log - foobar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: jeu. 02 décembre 2010
+
+
+
+ Updated: dim. 17 novembre 2013
+
+
+
+ By Alexis Métaireau
+
+In yeah .
+tags: foo bar foobar
+ Some content here !
+
+
This is a simple title
+
And here comes the cool stuff .
+
+
+
+>>> from ipdb import set_trace
+>>> set_trace()
+
+
→ And now try with some utf8 hell: ééé
+
+There are comments .
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tag/oh.html b/pelican/tests/output/custom_locale/tag/oh.html
new file mode 100644
index 00000000..21c8e352
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tag/oh.html
@@ -0,0 +1,80 @@
+
+
+
+
+ Oh Oh Oh
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Oh Oh Oh
+
+ This page overrides the listening of the articles under the oh tag.
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tag/yeah.html b/pelican/tests/output/custom_locale/tag/yeah.html
new file mode 100644
index 00000000..a8fe6f51
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tag/yeah.html
@@ -0,0 +1,101 @@
+
+
+
+
+ Alexis' log - yeah
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Published: mer. 20 octobre 2010
+
+
+
+ By Alexis Métaireau
+
+In bar .
+tags: oh bar yeah
Translations:
+ fr
+
+
+
Why not ?
+
After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst !
+YEAH !
+
+
+There are comments .
+
+ Page 1 / 1
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/tags.html b/pelican/tests/output/custom_locale/tags.html
new file mode 100644
index 00000000..0da0d291
--- /dev/null
+++ b/pelican/tests/output/custom_locale/tags.html
@@ -0,0 +1,87 @@
+
+
+
+
+ Alexis' log - Tags
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tags for Alexis' log
+
+
+
+
+
+
+
+ Proudly powered by Pelican , which takes great advantage of Python .
+
+
+ The theme is by Smashing Magazine , thanks!
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/theme/css/main.css b/pelican/tests/output/custom_locale/theme/css/main.css
new file mode 100644
index 00000000..2efb518d
--- /dev/null
+++ b/pelican/tests/output/custom_locale/theme/css/main.css
@@ -0,0 +1,451 @@
+/*
+ Name: Smashing HTML5
+ Date: July 2009
+ Description: Sample layout for HTML5 and CSS3 goodness.
+ Version: 1.0
+ License: MIT
+ Licensed by: Smashing Media GmbH
+ Original author: Enrique Ramírez
+*/
+
+/* Imports */
+@import url("reset.css");
+@import url("pygment.css");
+@import url("typogrify.css");
+@import url(//fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin);
+
+/***** Global *****/
+/* Body */
+body {
+ background: #F5F4EF;
+ color: #000305;
+ font-size: 87.5%; /* Base font size: 14px */
+ font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
+ line-height: 1.429;
+ margin: 0;
+ padding: 0;
+ text-align: left;
+}
+
+/* Headings */
+h1 {font-size: 2em }
+h2 {font-size: 1.571em} /* 22px */
+h3 {font-size: 1.429em} /* 20px */
+h4 {font-size: 1.286em} /* 18px */
+h5 {font-size: 1.143em} /* 16px */
+h6 {font-size: 1em} /* 14px */
+
+h1, h2, h3, h4, h5, h6 {
+ font-weight: 400;
+ line-height: 1.1;
+ margin-bottom: .8em;
+ font-family: 'Yanone Kaffeesatz', arial, serif;
+}
+
+h3, h4, h5, h6 { margin-top: .8em; }
+
+hr { border: 2px solid #EEEEEE; }
+
+/* Anchors */
+a {outline: 0;}
+a img {border: 0px; text-decoration: none;}
+a:link, a:visited {
+ color: #C74350;
+ padding: 0 1px;
+ text-decoration: underline;
+}
+a:hover, a:active {
+ background-color: #C74350;
+ color: #fff;
+ text-decoration: none;
+ text-shadow: 1px 1px 1px #333;
+}
+
+h1 a:hover {
+ background-color: inherit
+}
+
+/* Paragraphs */
+div.line-block,
+p { margin-top: 1em;
+ margin-bottom: 1em;}
+
+strong, b {font-weight: bold;}
+em, i {font-style: italic;}
+
+/* Lists */
+ul {
+ list-style: outside disc;
+ margin: 0em 0 0 1.5em;
+}
+
+ol {
+ list-style: outside decimal;
+ margin: 0em 0 0 1.5em;
+}
+
+li { margin-top: 0.5em;}
+
+.post-info {
+ float:right;
+ margin:10px;
+ padding:5px;
+}
+
+.post-info p{
+ margin-top: 1px;
+ margin-bottom: 1px;
+}
+
+.readmore { float: right }
+
+dl {margin: 0 0 1.5em 0;}
+dt {font-weight: bold;}
+dd {margin-left: 1.5em;}
+
+pre{background-color: rgb(238, 238, 238); padding: 10px; margin: 10px; overflow: auto;}
+
+/* Quotes */
+blockquote {
+ margin: 20px;
+ font-style: italic;
+}
+cite {}
+
+q {}
+
+div.note {
+ float: right;
+ margin: 5px;
+ font-size: 85%;
+ max-width: 300px;
+}
+
+/* Tables */
+table {margin: .5em auto 1.5em auto; width: 98%;}
+
+ /* Thead */
+ thead th {padding: .5em .4em; text-align: left;}
+ thead td {}
+
+ /* Tbody */
+ tbody td {padding: .5em .4em;}
+ tbody th {}
+
+ tbody .alt td {}
+ tbody .alt th {}
+
+ /* Tfoot */
+ tfoot th {}
+ tfoot td {}
+
+/* HTML5 tags */
+header, section, footer,
+aside, nav, article, figure {
+ display: block;
+}
+
+/***** Layout *****/
+.body {clear: both; margin: 0 auto; width: 800px;}
+img.right, figure.right {float: right; margin: 0 0 2em 2em;}
+img.left, figure.left {float: left; margin: 0 2em 2em 0;}
+
+/*
+ Header
+*****************/
+#banner {
+ margin: 0 auto;
+ padding: 2.5em 0 0 0;
+}
+
+ /* Banner */
+ #banner h1 {font-size: 3.571em; line-height: 0;}
+ #banner h1 a:link, #banner h1 a:visited {
+ color: #000305;
+ display: block;
+ font-weight: bold;
+ margin: 0 0 .6em .2em;
+ text-decoration: none;
+ }
+ #banner h1 a:hover, #banner h1 a:active {
+ background: none;
+ color: #C74350;
+ text-shadow: none;
+ }
+
+ #banner h1 strong {font-size: 0.36em; font-weight: normal;}
+
+ /* Main Nav */
+ #banner nav {
+ background: #000305;
+ font-size: 1.143em;
+ height: 40px;
+ line-height: 30px;
+ margin: 0 auto 2em auto;
+ padding: 0;
+ text-align: center;
+ width: 800px;
+
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ }
+
+ #banner nav ul {list-style: none; margin: 0 auto; width: 800px;}
+ #banner nav li {float: left; display: inline; margin: 0;}
+
+ #banner nav a:link, #banner nav a:visited {
+ color: #fff;
+ display: inline-block;
+ height: 30px;
+ padding: 5px 1.5em;
+ text-decoration: none;
+ }
+ #banner nav a:hover, #banner nav a:active,
+ #banner nav .active a:link, #banner nav .active a:visited {
+ background: #C74451;
+ color: #fff;
+ text-shadow: none !important;
+ }
+
+ #banner nav li:first-child a {
+ border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ -webkit-border-top-left-radius: 5px;
+
+ border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ }
+
+/*
+ Featured
+*****************/
+#featured {
+ background: #fff;
+ margin-bottom: 2em;
+ overflow: hidden;
+ padding: 20px;
+ width: 760px;
+
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+}
+
+#featured figure {
+ border: 2px solid #eee;
+ float: right;
+ margin: 0.786em 2em 0 5em;
+ width: 248px;
+}
+#featured figure img {display: block; float: right;}
+
+#featured h2 {color: #C74451; font-size: 1.714em; margin-bottom: 0.333em;}
+#featured h3 {font-size: 1.429em; margin-bottom: .5em;}
+
+#featured h3 a:link, #featured h3 a:visited {color: #000305; text-decoration: none;}
+#featured h3 a:hover, #featured h3 a:active {color: #fff;}
+
+/*
+ Body
+*****************/
+#content {
+ background: #fff;
+ margin-bottom: 2em;
+ overflow: hidden;
+ padding: 20px 20px;
+ width: 760px;
+
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+}
+
+/*
+ Extras
+*****************/
+#extras {margin: 0 auto 3em auto; overflow: hidden;}
+
+#extras ul {list-style: none; margin: 0;}
+#extras li {border-bottom: 1px solid #fff;}
+#extras h2 {
+ color: #C74350;
+ font-size: 1.429em;
+ margin-bottom: .25em;
+ padding: 0 3px;
+}
+
+#extras a:link, #extras a:visited {
+ color: #444;
+ display: block;
+ border-bottom: 1px solid #F4E3E3;
+ text-decoration: none;
+ padding: .3em .25em;
+}
+
+#extras a:hover, #extras a:active {color: #fff;}
+
+ /* Blogroll */
+ #extras .blogroll {
+ float: left;
+ width: 615px;
+ }
+
+ #extras .blogroll li {float: left; margin: 0 20px 0 0; width: 185px;}
+
+ /* Social */
+ #extras .social {
+ float: right;
+ width: 175px;
+ }
+
+ #extras div[class='social'] a {
+ background-repeat: no-repeat;
+ background-position: 3px 6px;
+ padding-left: 25px;
+ }
+
+ /* Icons */
+ .social a[href*='about.me'] {background-image: url('../images/icons/aboutme.png');}
+ .social a[href*='bitbucket.org'] {background-image: url('../images/icons/bitbucket.png');}
+ .social a[href*='delicious.com'] {background-image: url('../images/icons/delicious.png');}
+ .social a[href*='digg.com'] {background-image: url('../images/icons/digg.png');}
+ .social a[href*='facebook.com'] {background-image: url('../images/icons/facebook.png');}
+ .social a[href*='gitorious.org'] {background-image: url('../images/icons/gitorious.png');}
+ .social a[href*='github.com'],
+ .social a[href*='git.io'] {
+ background-image: url('../images/icons/github.png');
+ background-size: 16px 16px;
+ }
+ .social a[href*='gittip.com'] {background-image: url('../images/icons/gittip.png');}
+ .social a[href*='plus.google.com'] {background-image: url('../images/icons/google-plus.png');}
+ .social a[href*='groups.google.com'] {background-image: url('../images/icons/google-groups.png');}
+ .social a[href*='news.ycombinator.com'],
+ .social a[href*='hackernewsers.com'] {background-image: url('../images/icons/hackernews.png');}
+ .social a[href*='last.fm'], .social a[href*='lastfm.'] {background-image: url('../images/icons/lastfm.png');}
+ .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');}
+ .social a[href*='reddit.com'] {background-image: url('../images/icons/reddit.png');}
+ .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');}
+ .social a[href*='slideshare.net'] {background-image: url('../images/icons/slideshare.png');}
+ .social a[href*='speakerdeck.com'] {background-image: url('../images/icons/speakerdeck.png');}
+ .social a[href*='stackoverflow.com'] {background-image: url('../images/icons/stackoverflow.png');}
+ .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');}
+ .social a[href*='vimeo.com'] {background-image: url('../images/icons/vimeo.png');}
+ .social a[href*='youtube.com'] {background-image: url('../images/icons/youtube.png');}
+
+/*
+ About
+*****************/
+#about {
+ background: #fff;
+ font-style: normal;
+ margin-bottom: 2em;
+ overflow: hidden;
+ padding: 20px;
+ text-align: left;
+ width: 760px;
+
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+}
+
+#about .primary {float: left; width: 165px;}
+#about .primary strong {color: #C64350; display: block; font-size: 1.286em;}
+#about .photo {float: left; margin: 5px 20px;}
+
+#about .url:link, #about .url:visited {text-decoration: none;}
+
+#about .bio {float: right; width: 500px;}
+
+/*
+ Footer
+*****************/
+#contentinfo {padding-bottom: 2em; text-align: right;}
+
+/***** Sections *****/
+/* Blog */
+.hentry {
+ display: block;
+ clear: both;
+ border-bottom: 1px solid #eee;
+ padding: 1.5em 0;
+}
+li:last-child .hentry, #content > .hentry {border: 0; margin: 0;}
+#content > .hentry {padding: 1em 0;}
+.hentry img{display : none ;}
+.entry-title {font-size: 3em; margin-bottom: 10px; margin-top: 0;}
+.entry-title a:link, .entry-title a:visited {text-decoration: none; color: #333;}
+.entry-title a:visited {background-color: #fff;}
+
+.hentry .post-info * {font-style: normal;}
+
+ /* Content */
+ .hentry footer {margin-bottom: 2em;}
+ .hentry footer address {display: inline;}
+ #posts-list footer address {display: block;}
+
+ /* Blog Index */
+ #posts-list {list-style: none; margin: 0;}
+ #posts-list .hentry {padding-left: 10px; position: relative;}
+
+ #posts-list footer {
+ left: 10px;
+ position: relative;
+ float: left;
+ top: 0.5em;
+ width: 190px;
+ }
+
+ /* About the Author */
+ #about-author {
+ background: #f9f9f9;
+ clear: both;
+ font-style: normal;
+ margin: 2em 0;
+ padding: 10px 20px 15px 20px;
+
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ }
+
+ #about-author strong {
+ color: #C64350;
+ clear: both;
+ display: block;
+ font-size: 1.429em;
+ }
+
+ #about-author .photo {border: 1px solid #ddd; float: left; margin: 5px 1em 0 0;}
+
+ /* Comments */
+ #comments-list {list-style: none; margin: 0 1em;}
+ #comments-list blockquote {
+ background: #f8f8f8;
+ clear: both;
+ font-style: normal;
+ margin: 0;
+ padding: 15px 20px;
+
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ }
+ #comments-list footer {color: #888; padding: .5em 1em 0 0; text-align: right;}
+
+ #comments-list li:nth-child(2n) blockquote {background: #F5f5f5;}
+
+ /* Add a Comment */
+ #add-comment label {clear: left; float: left; text-align: left; width: 150px;}
+ #add-comment input[type='text'],
+ #add-comment input[type='email'],
+ #add-comment input[type='url'] {float: left; width: 200px;}
+
+ #add-comment textarea {float: left; height: 150px; width: 495px;}
+
+ #add-comment p.req {clear: both; margin: 0 .5em 1em 0; text-align: right;}
+
+ #add-comment input[type='submit'] {float: right; margin: 0 .5em;}
+ #add-comment * {margin-bottom: .5em;}
diff --git a/pelican/tests/output/custom_locale/theme/css/pygment.css b/pelican/tests/output/custom_locale/theme/css/pygment.css
new file mode 100644
index 00000000..fdd056f6
--- /dev/null
+++ b/pelican/tests/output/custom_locale/theme/css/pygment.css
@@ -0,0 +1,205 @@
+.hll {
+background-color:#eee;
+}
+.c {
+color:#408090;
+font-style:italic;
+}
+.err {
+border:1px solid #FF0000;
+}
+.k {
+color:#007020;
+font-weight:bold;
+}
+.o {
+color:#666666;
+}
+.cm {
+color:#408090;
+font-style:italic;
+}
+.cp {
+color:#007020;
+}
+.c1 {
+color:#408090;
+font-style:italic;
+}
+.cs {
+background-color:#FFF0F0;
+color:#408090;
+}
+.gd {
+color:#A00000;
+}
+.ge {
+font-style:italic;
+}
+.gr {
+color:#FF0000;
+}
+.gh {
+color:#000080;
+font-weight:bold;
+}
+.gi {
+color:#00A000;
+}
+.go {
+color:#303030;
+}
+.gp {
+color:#C65D09;
+font-weight:bold;
+}
+.gs {
+font-weight:bold;
+}
+.gu {
+color:#800080;
+font-weight:bold;
+}
+.gt {
+color:#0040D0;
+}
+.kc {
+color:#007020;
+font-weight:bold;
+}
+.kd {
+color:#007020;
+font-weight:bold;
+}
+.kn {
+color:#007020;
+font-weight:bold;
+}
+.kp {
+color:#007020;
+}
+.kr {
+color:#007020;
+font-weight:bold;
+}
+.kt {
+color:#902000;
+}
+.m {
+color:#208050;
+}
+.s {
+color:#4070A0;
+}
+.na {
+color:#4070A0;
+}
+.nb {
+color:#007020;
+}
+.nc {
+color:#0E84B5;
+font-weight:bold;
+}
+.no {
+color:#60ADD5;
+}
+.nd {
+color:#555555;
+font-weight:bold;
+}
+.ni {
+color:#D55537;
+font-weight:bold;
+}
+.ne {
+color:#007020;
+}
+.nf {
+color:#06287E;
+}
+.nl {
+color:#002070;
+font-weight:bold;
+}
+.nn {
+color:#0E84B5;
+font-weight:bold;
+}
+.nt {
+color:#062873;
+font-weight:bold;
+}
+.nv {
+color:#BB60D5;
+}
+.ow {
+color:#007020;
+font-weight:bold;
+}
+.w {
+color:#BBBBBB;
+}
+.mf {
+color:#208050;
+}
+.mh {
+color:#208050;
+}
+.mi {
+color:#208050;
+}
+.mo {
+color:#208050;
+}
+.sb {
+color:#4070A0;
+}
+.sc {
+color:#4070A0;
+}
+.sd {
+color:#4070A0;
+font-style:italic;
+}
+.s2 {
+color:#4070A0;
+}
+.se {
+color:#4070A0;
+font-weight:bold;
+}
+.sh {
+color:#4070A0;
+}
+.si {
+color:#70A0D0;
+font-style:italic;
+}
+.sx {
+color:#C65D09;
+}
+.sr {
+color:#235388;
+}
+.s1 {
+color:#4070A0;
+}
+.ss {
+color:#517918;
+}
+.bp {
+color:#007020;
+}
+.vc {
+color:#BB60D5;
+}
+.vg {
+color:#BB60D5;
+}
+.vi {
+color:#BB60D5;
+}
+.il {
+color:#208050;
+}
diff --git a/pelican/tests/output/custom_locale/theme/css/reset.css b/pelican/tests/output/custom_locale/theme/css/reset.css
new file mode 100644
index 00000000..1e217566
--- /dev/null
+++ b/pelican/tests/output/custom_locale/theme/css/reset.css
@@ -0,0 +1,52 @@
+/*
+ Name: Reset Stylesheet
+ Description: Resets browser's default CSS
+ Author: Eric Meyer
+ Author URI: http://meyerweb.com/eric/tools/css/reset/
+*/
+
+/* v1.0 | 20080212 */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ background: transparent;
+ border: 0;
+ font-size: 100%;
+ margin: 0;
+ outline: 0;
+ padding: 0;
+ vertical-align: baseline;
+}
+
+body {line-height: 1;}
+
+ol, ul {list-style: none;}
+
+blockquote, q {quotes: none;}
+
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+
+/* remember to define focus styles! */
+:focus {
+ outline: 0;
+}
+
+/* remember to highlight inserts somehow! */
+ins {text-decoration: none;}
+del {text-decoration: line-through;}
+
+/* tables still need 'cellspacing="0"' in the markup */
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/theme/css/typogrify.css b/pelican/tests/output/custom_locale/theme/css/typogrify.css
new file mode 100644
index 00000000..c9b34dc8
--- /dev/null
+++ b/pelican/tests/output/custom_locale/theme/css/typogrify.css
@@ -0,0 +1,3 @@
+.caps {font-size:.92em;}
+.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;}
+.dquo {margin-left:-.38em;}
diff --git a/pelican/tests/output/custom_locale/theme/css/wide.css b/pelican/tests/output/custom_locale/theme/css/wide.css
new file mode 100644
index 00000000..88fd59ce
--- /dev/null
+++ b/pelican/tests/output/custom_locale/theme/css/wide.css
@@ -0,0 +1,48 @@
+@import url("main.css");
+
+body {
+ font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif;
+}
+
+.post-info{
+ display: none;
+}
+
+#banner nav {
+ display: none;
+ -moz-border-radius: 0px;
+ margin-bottom: 20px;
+ overflow: hidden;
+ font-size: 1em;
+ background: #F5F4EF;
+}
+
+#banner nav ul{
+ padding-right: 50px;
+}
+
+#banner nav li{
+ float: right;
+ color: #000;
+}
+
+#banner nav li a {
+ color: #000;
+}
+
+#banner h1 {
+ margin-bottom: -18px;
+}
+
+#featured, #extras {
+ padding: 50px;
+}
+
+#featured {
+ padding-top: 20px;
+}
+
+#extras {
+ padding-top: 0px;
+ padding-bottom: 0px;
+}
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/aboutme.png b/pelican/tests/output/custom_locale/theme/images/icons/aboutme.png
new file mode 100644
index 00000000..9609df3b
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/aboutme.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/bitbucket.png b/pelican/tests/output/custom_locale/theme/images/icons/bitbucket.png
new file mode 100644
index 00000000..d05ba161
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/bitbucket.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/delicious.png b/pelican/tests/output/custom_locale/theme/images/icons/delicious.png
new file mode 100644
index 00000000..3dccdd84
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/delicious.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/facebook.png b/pelican/tests/output/custom_locale/theme/images/icons/facebook.png
new file mode 100644
index 00000000..74e7ad52
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/facebook.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/github.png b/pelican/tests/output/custom_locale/theme/images/icons/github.png
new file mode 100644
index 00000000..8b25551a
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/github.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/gitorious.png b/pelican/tests/output/custom_locale/theme/images/icons/gitorious.png
new file mode 100644
index 00000000..3eeb3ece
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/gitorious.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/gittip.png b/pelican/tests/output/custom_locale/theme/images/icons/gittip.png
new file mode 100644
index 00000000..af949625
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/gittip.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/google-groups.png b/pelican/tests/output/custom_locale/theme/images/icons/google-groups.png
new file mode 100644
index 00000000..5de15e68
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/google-groups.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/google-plus.png b/pelican/tests/output/custom_locale/theme/images/icons/google-plus.png
new file mode 100644
index 00000000..3c6b7432
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/google-plus.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/hackernews.png b/pelican/tests/output/custom_locale/theme/images/icons/hackernews.png
new file mode 100644
index 00000000..fc7a82d4
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/hackernews.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/lastfm.png b/pelican/tests/output/custom_locale/theme/images/icons/lastfm.png
new file mode 100644
index 00000000..3a6c6262
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/lastfm.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/linkedin.png b/pelican/tests/output/custom_locale/theme/images/icons/linkedin.png
new file mode 100644
index 00000000..d29c1201
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/linkedin.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/reddit.png b/pelican/tests/output/custom_locale/theme/images/icons/reddit.png
new file mode 100644
index 00000000..71ae1215
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/reddit.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/rss.png b/pelican/tests/output/custom_locale/theme/images/icons/rss.png
new file mode 100644
index 00000000..7862c65a
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/rss.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/slideshare.png b/pelican/tests/output/custom_locale/theme/images/icons/slideshare.png
new file mode 100644
index 00000000..ecc97410
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/slideshare.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/speakerdeck.png b/pelican/tests/output/custom_locale/theme/images/icons/speakerdeck.png
new file mode 100644
index 00000000..087d0931
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/speakerdeck.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/stackoverflow.png b/pelican/tests/output/custom_locale/theme/images/icons/stackoverflow.png
new file mode 100644
index 00000000..f5b65e99
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/stackoverflow.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/twitter.png b/pelican/tests/output/custom_locale/theme/images/icons/twitter.png
new file mode 100644
index 00000000..d0ef3cc1
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/twitter.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/vimeo.png b/pelican/tests/output/custom_locale/theme/images/icons/vimeo.png
new file mode 100644
index 00000000..dba47202
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/vimeo.png differ
diff --git a/pelican/tests/output/custom_locale/theme/images/icons/youtube.png b/pelican/tests/output/custom_locale/theme/images/icons/youtube.png
new file mode 100644
index 00000000..ce6cbe4f
Binary files /dev/null and b/pelican/tests/output/custom_locale/theme/images/icons/youtube.png differ
diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py
index 3c0f8d75..e64b3804 100644
--- a/pelican/tests/test_contents.py
+++ b/pelican/tests/test_contents.py
@@ -2,7 +2,6 @@
from __future__ import unicode_literals, absolute_import
import six
-from datetime import datetime
from sys import platform
import locale
@@ -10,7 +9,7 @@ from pelican.tests.support import unittest, get_settings
from pelican.contents import Page, Article, URLWrapper
from pelican.settings import DEFAULT_CONFIG
-from pelican.utils import truncate_html_words
+from pelican.utils import truncate_html_words, SafeDatetime
from pelican.signals import content_object_init
from jinja2.utils import generate_lorem_ipsum
@@ -127,7 +126,7 @@ class TestPage(unittest.TestCase):
def test_datetime(self):
# If DATETIME is set to a tuple, it should be used to override LOCALE
- dt = datetime(2015, 9, 13)
+ dt = SafeDatetime(2015, 9, 13)
page_kwargs = self._copy_page_kwargs()
diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py
index 411fb7da..cfae594a 100644
--- a/pelican/tests/test_pelican.py
+++ b/pelican/tests/test_pelican.py
@@ -2,6 +2,7 @@
from __future__ import unicode_literals, print_function
import os
+import sys
from tempfile import mkdtemp
from shutil import rmtree
import locale
@@ -10,7 +11,7 @@ import subprocess
from pelican import Pelican
from pelican.settings import read_settings
-from pelican.tests.support import LoggedTestCase, mute
+from pelican.tests.support import LoggedTestCase, mute, locale_available, unittest
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
SAMPLES_PATH = os.path.abspath(os.path.join(
@@ -19,6 +20,7 @@ OUTPUT_PATH = os.path.abspath(os.path.join(CURRENT_DIR, 'output'))
INPUT_PATH = os.path.join(SAMPLES_PATH, "content")
SAMPLE_CONFIG = os.path.join(SAMPLES_PATH, "pelican.conf.py")
+SAMPLE_FR_CONFIG = os.path.join(SAMPLES_PATH, "pelican_FR.conf.py")
def recursiveDiff(dcmp):
@@ -102,6 +104,27 @@ class TestPelican(LoggedTestCase):
mute(True)(pelican.run)()
self.assertDirsEqual(self.temp_path, os.path.join(OUTPUT_PATH, 'custom'))
+ @unittest.skipUnless(locale_available('fr_FR.UTF-8') or
+ locale_available('French'), 'French locale needed')
+ def test_custom_locale_generation_works(self):
+ '''Test that generation with fr_FR.UTF-8 locale works'''
+ old_locale = locale.setlocale(locale.LC_TIME)
+
+ if sys.platform == 'win32':
+ our_locale = str('French')
+ else:
+ our_locale = str('fr_FR.UTF-8')
+
+ settings = read_settings(path=SAMPLE_FR_CONFIG, override={
+ 'PATH': INPUT_PATH,
+ 'OUTPUT_PATH': self.temp_path,
+ 'CACHE_PATH': self.temp_cache,
+ 'LOCALE': our_locale,
+ })
+ pelican = Pelican(settings=settings)
+ mute(True)(pelican.run)()
+ self.assertDirsEqual(self.temp_path, os.path.join(OUTPUT_PATH, 'custom_locale'))
+
def test_theme_static_paths_copy(self):
# the same thing with a specified set of settings should work
settings = read_settings(path=SAMPLE_CONFIG, override={
diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py
index 6228989b..d853587f 100644
--- a/pelican/tests/test_readers.py
+++ b/pelican/tests/test_readers.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
-import datetime
import os
from pelican import readers
+from pelican.utils import SafeDatetime
from pelican.tests.support import unittest, get_settings
CUR_DIR = os.path.dirname(__file__)
@@ -42,8 +42,8 @@ class RstReaderTest(ReaderTest):
' supported\nas well as inline'
' markup and stuff to "typogrify'
'"...
\n',
- 'date': datetime.datetime(2010, 12, 2, 10, 14),
- 'modified': datetime.datetime(2010, 12, 2, 10, 20),
+ 'date': SafeDatetime(2010, 12, 2, 10, 14),
+ 'modified': SafeDatetime(2010, 12, 2, 10, 20),
'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org',
}
@@ -70,7 +70,7 @@ class RstReaderTest(ReaderTest):
'category': 'yeah',
'author': 'Alexis Métaireau',
'title': 'Rst with filename metadata',
- 'date': datetime.datetime(2012, 11, 29),
+ 'date': SafeDatetime(2012, 11, 29),
}
for key, value in page.metadata.items():
self.assertEqual(value, expected[key], key)
@@ -85,7 +85,7 @@ class RstReaderTest(ReaderTest):
'category': 'yeah',
'author': 'Alexis Métaireau',
'title': 'Rst with filename metadata',
- 'date': datetime.datetime(2012, 11, 29),
+ 'date': SafeDatetime(2012, 11, 29),
'slug': 'article_with_filename_metadata',
'mymeta': 'foo',
}
@@ -171,8 +171,8 @@ class MdReaderTest(ReaderTest):
'category': 'test',
'title': 'Test md File',
'summary': 'I have a lot to test
',
- 'date': datetime.datetime(2010, 12, 2, 10, 14),
- 'modified': datetime.datetime(2010, 12, 2, 10, 20),
+ 'date': SafeDatetime(2010, 12, 2, 10, 14),
+ 'modified': SafeDatetime(2010, 12, 2, 10, 20),
'tags': ['foo', 'bar', 'foobar'],
}
for key, value in metadata.items():
@@ -184,8 +184,8 @@ class MdReaderTest(ReaderTest):
'title': 'マックOS X 10.8でパイソンとVirtualenvをインストールと設定',
'summary': 'パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。
',
'category': '指導書',
- 'date': datetime.datetime(2012, 12, 20),
- 'modified': datetime.datetime(2012, 12, 22),
+ 'date': SafeDatetime(2012, 12, 20),
+ 'modified': SafeDatetime(2012, 12, 22),
'tags': ['パイソン', 'マック'],
'slug': 'python-virtualenv-on-mac-osx-mountain-lion-10.8',
}
@@ -220,8 +220,8 @@ class MdReaderTest(ReaderTest):
'summary': (
'Summary with inline markup '
'should be supported.
'),
- 'date': datetime.datetime(2012, 10, 31),
- 'modified': datetime.datetime(2012, 11, 1),
+ 'date': SafeDatetime(2012, 10, 31),
+ 'modified': SafeDatetime(2012, 11, 1),
'slug': 'article-with-markdown-containing-footnotes',
'multiline': [
'Line Metadata should be handle properly.',
@@ -311,7 +311,7 @@ class MdReaderTest(ReaderTest):
expected = {
'category': 'yeah',
'author': 'Alexis Métaireau',
- 'date': datetime.datetime(2012, 11, 30),
+ 'date': SafeDatetime(2012, 11, 30),
}
for key, value in expected.items():
self.assertEqual(value, page.metadata[key], key)
@@ -325,7 +325,7 @@ class MdReaderTest(ReaderTest):
expected = {
'category': 'yeah',
'author': 'Alexis Métaireau',
- 'date': datetime.datetime(2012, 11, 30),
+ 'date': SafeDatetime(2012, 11, 30),
'slug': 'md_w_filename_meta',
'mymeta': 'foo',
}
@@ -358,7 +358,7 @@ class HTMLReaderTest(ReaderTest):
'author': 'Alexis Métaireau',
'title': 'This is a super article !',
'summary': 'Summary and stuff',
- 'date': datetime.datetime(2010, 12, 2, 10, 14),
+ 'date': SafeDatetime(2010, 12, 2, 10, 14),
'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org',
}
@@ -382,7 +382,7 @@ class HTMLReaderTest(ReaderTest):
'author': 'Alexis Métaireau',
'title': 'This is a super article !',
'summary': 'Summary and stuff',
- 'date': datetime.datetime(2010, 12, 2, 10, 14),
+ 'date': SafeDatetime(2010, 12, 2, 10, 14),
'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org',
}
diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py
index 3c12a15b..df1918b5 100644
--- a/pelican/tests/test_utils.py
+++ b/pelican/tests/test_utils.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals, print_function, absolute_import
import logging
import shutil
import os
-import datetime
import time
import locale
from sys import platform, version_info
@@ -38,24 +37,24 @@ class TestUtils(LoggedTestCase):
def test_get_date(self):
# valid ones
- date = datetime.datetime(year=2012, month=11, day=22)
- date_hour = datetime.datetime(
+ date = utils.SafeDatetime(year=2012, month=11, day=22)
+ date_hour = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11)
- date_hour_z = datetime.datetime(
+ date_hour_z = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11,
tzinfo=pytz.timezone('UTC'))
- date_hour_est = datetime.datetime(
+ date_hour_est = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11,
tzinfo=pytz.timezone('EST'))
- date_hour_sec = datetime.datetime(
+ date_hour_sec = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11, second=10)
- date_hour_sec_z = datetime.datetime(
+ date_hour_sec_z = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11, second=10,
tzinfo=pytz.timezone('UTC'))
- date_hour_sec_est = datetime.datetime(
+ date_hour_sec_est = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11, second=10,
tzinfo=pytz.timezone('EST'))
- date_hour_sec_frac_z = datetime.datetime(
+ date_hour_sec_frac_z = utils.SafeDatetime(
year=2012, month=11, day=22, hour=22, minute=11, second=10,
microsecond=123000, tzinfo=pytz.timezone('UTC'))
dates = {
@@ -76,14 +75,14 @@ class TestUtils(LoggedTestCase):
}
# examples from http://www.w3.org/TR/NOTE-datetime
- iso_8601_date = datetime.datetime(year=1997, month=7, day=16)
- iso_8601_date_hour_tz = datetime.datetime(
+ iso_8601_date = utils.SafeDatetime(year=1997, month=7, day=16)
+ iso_8601_date_hour_tz = utils.SafeDatetime(
year=1997, month=7, day=16, hour=19, minute=20,
tzinfo=pytz.timezone('CET'))
- iso_8601_date_hour_sec_tz = datetime.datetime(
+ iso_8601_date_hour_sec_tz = utils.SafeDatetime(
year=1997, month=7, day=16, hour=19, minute=20, second=30,
tzinfo=pytz.timezone('CET'))
- iso_8601_date_hour_sec_ms_tz = datetime.datetime(
+ iso_8601_date_hour_sec_ms_tz = utils.SafeDatetime(
year=1997, month=7, day=16, hour=19, minute=20, second=30,
microsecond=450000, tzinfo=pytz.timezone('CET'))
iso_8601 = {
@@ -258,7 +257,7 @@ class TestUtils(LoggedTestCase):
self.assertFalse(os.path.exists(test_directory))
def test_strftime(self):
- d = datetime.date(2012, 8, 29)
+ d = utils.SafeDatetime(2012, 8, 29)
# simple formatting
self.assertEqual(utils.strftime(d, '%d/%m/%y'), '29/08/12')
@@ -296,7 +295,7 @@ class TestUtils(LoggedTestCase):
else:
locale.setlocale(locale.LC_TIME, str('tr_TR.UTF-8'))
- d = datetime.date(2012, 8, 29)
+ d = utils.SafeDatetime(2012, 8, 29)
# simple
self.assertEqual(utils.strftime(d, '%d %B %Y'), '29 Ağustos 2012')
@@ -329,7 +328,7 @@ class TestUtils(LoggedTestCase):
else:
locale.setlocale(locale.LC_TIME, str('fr_FR.UTF-8'))
- d = datetime.date(2012, 8, 29)
+ d = utils.SafeDatetime(2012, 8, 29)
# simple
self.assertEqual(utils.strftime(d, '%d %B %Y'), '29 août 2012')
@@ -448,7 +447,7 @@ class TestDateFormatter(unittest.TestCase):
os.makedirs(template_dir)
with open(template_path, 'w') as template_file:
template_file.write('date = {{ date|strftime("%A, %d %B %Y") }}')
- self.date = datetime.date(2012, 8, 29)
+ self.date = utils.SafeDatetime(2012, 8, 29)
def tearDown(self):
@@ -464,7 +463,7 @@ class TestDateFormatter(unittest.TestCase):
def test_french_strftime(self):
# This test tries to reproduce an issue that occured with python3.3 under macos10 only
locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8'))
- date = datetime.datetime(2014,8,14)
+ date = utils.SafeDatetime(2014,8,14)
# we compare the lower() dates since macos10 returns "Jeudi" for %A whereas linux reports "jeudi"
self.assertEqual( u'jeudi, 14 août 2014', utils.strftime(date, date_format="%A, %d %B %Y").lower() )
df = utils.DateFormatter()
diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py
index 7c8662c9..b6078201 100755
--- a/pelican/tools/pelican_import.py
+++ b/pelican/tools/pelican_import.py
@@ -21,7 +21,7 @@ from six.moves.urllib.error import URLError
from six.moves.urllib.parse import urlparse
from six.moves.urllib.request import urlretrieve
-from pelican.utils import slugify
+from pelican.utils import slugify, SafeDatetime
from pelican.log import init
logger = logging.getLogger(__name__)
@@ -303,7 +303,7 @@ def dc2fields(file):
def posterous2fields(api_token, email, password):
"""Imports posterous posts"""
import base64
- from datetime import datetime, timedelta
+ from datetime import timedelta
try:
# py3k import
import json
@@ -340,7 +340,7 @@ def posterous2fields(api_token, email, password):
slug = slugify(post.get('title'))
tags = [tag.get('name') for tag in post.get('tags')]
raw_date = post.get('display_date')
- date_object = datetime.strptime(raw_date[:-6], "%Y/%m/%d %H:%M:%S")
+ date_object = SafeDatetime.strptime(raw_date[:-6], "%Y/%m/%d %H:%M:%S")
offset = int(raw_date[-5:])
delta = timedelta(hours = offset / 100)
date_object -= delta
diff --git a/pelican/utils.py b/pelican/utils.py
index 84b3a41e..586d85ff 100644
--- a/pelican/utils.py
+++ b/pelican/utils.py
@@ -14,6 +14,7 @@ import shutil
import traceback
import pickle
import hashlib
+import datetime
from collections import Hashable
from contextlib import contextmanager
@@ -56,7 +57,10 @@ def strftime(date, date_format):
for candidate in candidates:
# test for valid C89 directives only
if candidate[1] in 'aAbBcdfHIjmMpSUwWxXyYzZ%':
- formatted = date.strftime(candidate)
+ if isinstance(date, SafeDatetime):
+ formatted = date.strftime(candidate, safe=False)
+ else:
+ formatted = date.strftime(candidate)
# convert Py2 result to unicode
if not six.PY3 and enc is not None:
formatted = formatted.decode(enc)
@@ -68,6 +72,17 @@ def strftime(date, date_format):
return template % tuple(formatted_candidates)
+class SafeDatetime(datetime.datetime):
+ '''Subclass of datetime that works with utf-8 format strings on PY2'''
+
+ def strftime(self, fmt, safe=True):
+ '''Uses our custom strftime if supposed to be *safe*'''
+ if safe:
+ return strftime(self, fmt)
+ else:
+ return super(SafeDatetime, self).strftime(fmt)
+
+
class DateFormatter(object):
'''A date formatter object used as a jinja filter
@@ -183,8 +198,10 @@ def get_date(string):
If no format matches the given date, raise a ValueError.
"""
string = re.sub(' +', ' ', string)
+ default = SafeDatetime.now().replace(hour=0, minute=0,
+ second=0, microsecond=0)
try:
- return dateutil.parser.parse(string)
+ return dateutil.parser.parse(string, default=default)
except (TypeError, ValueError):
raise ValueError('{0!r} is not a valid date'.format(string))
diff --git a/pelican/writers.py b/pelican/writers.py
index 3e01ee6c..61acdadd 100644
--- a/pelican/writers.py
+++ b/pelican/writers.py
@@ -151,12 +151,7 @@ class Writer(object):
def _write_file(template, localcontext, output_path, name, override):
"""Render the template write the file."""
- old_locale = locale.setlocale(locale.LC_ALL)
- locale.setlocale(locale.LC_ALL, str('C'))
- try:
- output = template.render(localcontext)
- finally:
- locale.setlocale(locale.LC_ALL, old_locale)
+ output = template.render(localcontext)
path = os.path.join(output_path, name)
try:
os.makedirs(os.path.dirname(path))
diff --git a/samples/pelican_FR.conf.py b/samples/pelican_FR.conf.py
new file mode 100644
index 00000000..1f6aaaa1
--- /dev/null
+++ b/samples/pelican_FR.conf.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+AUTHOR = 'Alexis Métaireau'
+SITENAME = "Alexis' log"
+SITEURL = 'http://blog.notmyidea.org'
+TIMEZONE = "Europe/Paris"
+
+# can be useful in development, but set to False when you're ready to publish
+RELATIVE_URLS = True
+
+GITHUB_URL = 'http://github.com/ametaireau/'
+DISQUS_SITENAME = "blog-notmyidea"
+PDF_GENERATOR = False
+REVERSE_CATEGORY_ORDER = True
+LOCALE = "fr_FR.UTF-8"
+DEFAULT_PAGINATION = 4
+DEFAULT_DATE = (2012, 3, 2, 14, 1, 1)
+
+ARTICLE_URL = 'posts/{date:%Y}/{date:%B}/{date:%d}/{slug}/'
+ARTICLE_SAVE_AS = ARTICLE_URL + 'index.html'
+
+FEED_ALL_RSS = 'feeds/all.rss.xml'
+CATEGORY_FEED_RSS = 'feeds/%s.rss.xml'
+
+LINKS = (('Biologeek', 'http://biologeek.org'),
+ ('Filyb', "http://filyb.info/"),
+ ('Libert-fr', "http://www.libert-fr.com"),
+ ('N1k0', "http://prendreuncafe.com/blog/"),
+ ('Tarek Ziadé', "http://ziade.org/blog"),
+ ('Zubin Mithra', "http://zubin71.wordpress.com/"),)
+
+SOCIAL = (('twitter', 'http://twitter.com/ametaireau'),
+ ('lastfm', 'http://lastfm.com/user/akounet'),
+ ('github', 'http://github.com/ametaireau'),)
+
+# global metadata to all the contents
+DEFAULT_METADATA = (('yeah', 'it is'),)
+
+# path-specific metadata
+EXTRA_PATH_METADATA = {
+ 'extra/robots.txt': {'path': 'robots.txt'},
+ }
+
+# static paths will be copied without parsing their contents
+STATIC_PATHS = [
+ 'pictures',
+ 'extra/robots.txt',
+ ]
+
+# custom page generated with a jinja2 template
+TEMPLATE_PAGES = {'pages/jinja2_template.html': 'jinja2_template.html'}
+
+# code blocks with line numbers
+PYGMENTS_RST_OPTIONS = {'linenos': 'table'}
+
+# foobar will not be used, because it's not in caps. All configuration keys
+# have to be in caps
+foobar = "barbaz"
Comments !
+ + + +