forked from github/pelican
Fix #1198, enable custom locale in template rendering, fixes links
reverts getpelican/pelican@ddcccfeaa9 If one used a locale that made use of unicode characters (like fr_FR.UTF-8) the files on disk would be in correct locale while links would be to C. Uses a SafeDatetime class that works with unicode format strigns by using custom strftime to prevent ascii decoding errors with Python2. Also added unicode decoding for the calendar module to fix period archives.
This commit is contained in:
parent
2432a22400
commit
3f6b130d6e
91 changed files with 5704 additions and 77 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
61
pelican/tests/output/custom_locale/feeds/all-en.atom.xml
Normal file
61
pelican/tests/output/custom_locale/feeds/all-en.atom.xml
Normal file
File diff suppressed because one or more lines are too long
4
pelican/tests/output/custom_locale/feeds/all-fr.atom.xml
Normal file
4
pelican/tests/output/custom_locale/feeds/all-fr.atom.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alexis' log</title><link href="http://blog.notmyidea.org/" rel="alternate"></link><link href="http://blog.notmyidea.org/feeds/all-fr.atom.xml" rel="self"></link><id>http://blog.notmyidea.org/</id><updated>2012-03-02T14:01:01+01:00</updated><entry><title>Trop bien !</title><link href="http://blog.notmyidea.org/oh-yeah-fr.html" rel="alternate"></link><updated>2012-03-02T14:01:01+01:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html</id><summary type="html"><p>Et voila du contenu en français</p>
|
||||
</summary></entry><entry><title>Deuxième article</title><link href="http://blog.notmyidea.org/second-article-fr.html" rel="alternate"></link><updated>2012-02-29T00:00:00+01:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2012-02-29:second-article-fr.html</id><summary type="html"><p>Ceci est un article, en français.</p>
|
||||
</summary><category term="foo"></category><category term="bar"></category><category term="baz"></category></entry></feed>
|
||||
63
pelican/tests/output/custom_locale/feeds/all.atom.xml
Normal file
63
pelican/tests/output/custom_locale/feeds/all.atom.xml
Normal file
File diff suppressed because one or more lines are too long
63
pelican/tests/output/custom_locale/feeds/all.rss.xml
Normal file
63
pelican/tests/output/custom_locale/feeds/all.rss.xml
Normal file
File diff suppressed because one or more lines are too long
8
pelican/tests/output/custom_locale/feeds/bar.atom.xml
Normal file
8
pelican/tests/output/custom_locale/feeds/bar.atom.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alexis' log</title><link href="http://blog.notmyidea.org/" rel="alternate"></link><link href="http://blog.notmyidea.org/feeds/bar.atom.xml" rel="self"></link><id>http://blog.notmyidea.org/</id><updated>2010-10-20T10:14:00+02:00</updated><entry><title>Oh yeah !</title><link href="http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/" rel="alternate"></link><updated>2010-10-20T10:14:00+02:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/</id><summary type="html"><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>
|
||||
</summary><category term="oh"></category><category term="bar"></category><category term="yeah"></category></entry></feed>
|
||||
8
pelican/tests/output/custom_locale/feeds/bar.rss.xml
Normal file
8
pelican/tests/output/custom_locale/feeds/bar.rss.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alexis' log</title><link>http://blog.notmyidea.org/</link><description></description><atom:link href="http://blog.notmyidea.org/feeds/bar.rss.xml" rel="self"></atom:link><lastBuildDate>Wed, 20 Oct 2010 10:14:00 +0200</lastBuildDate><item><title>Oh yeah !</title><link>http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/</link><description><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>
|
||||
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Wed, 20 Oct 2010 10:14:00 +0200</pubDate><guid>tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/</guid><category>oh</category><category>bar</category><category>yeah</category></item></channel></rss>
|
||||
7
pelican/tests/output/custom_locale/feeds/cat1.atom.xml
Normal file
7
pelican/tests/output/custom_locale/feeds/cat1.atom.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alexis' log</title><link href="http://blog.notmyidea.org/" rel="alternate"></link><link href="http://blog.notmyidea.org/feeds/cat1.atom.xml" rel="self"></link><id>http://blog.notmyidea.org/</id><updated>2011-04-20T00:00:00+02:00</updated><entry><title>A markdown powered article</title><link href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/" rel="alternate"></link><updated>2011-04-20T00:00:00+02:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/</id><summary type="html"><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></summary></entry><entry><title>Article 1</title><link href="http://blog.notmyidea.org/posts/2011/February/17/article-1/" rel="alternate"></link><updated>2011-02-17T00:00:00+01:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/</id><summary type="html"><p>Article 1</p>
|
||||
</summary></entry><entry><title>Article 2</title><link href="http://blog.notmyidea.org/posts/2011/February/17/article-2/" rel="alternate"></link><updated>2011-02-17T00:00:00+01:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/</id><summary type="html"><p>Article 2</p>
|
||||
</summary></entry><entry><title>Article 3</title><link href="http://blog.notmyidea.org/posts/2011/February/17/article-3/" rel="alternate"></link><updated>2011-02-17T00:00:00+01:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/</id><summary type="html"><p>Article 3</p>
|
||||
</summary></entry></feed>
|
||||
7
pelican/tests/output/custom_locale/feeds/cat1.rss.xml
Normal file
7
pelican/tests/output/custom_locale/feeds/cat1.rss.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alexis' log</title><link>http://blog.notmyidea.org/</link><description></description><atom:link href="http://blog.notmyidea.org/feeds/cat1.rss.xml" rel="self"></atom:link><lastBuildDate>Wed, 20 Apr 2011 00:00:00 +0200</lastBuildDate><item><title>A markdown powered article</title><link>http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/</link><description><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></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Wed, 20 Apr 2011 00:00:00 +0200</pubDate><guid>tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/</guid></item><item><title>Article 1</title><link>http://blog.notmyidea.org/posts/2011/February/17/article-1/</link><description><p>Article 1</p>
|
||||
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Thu, 17 Feb 2011 00:00:00 +0100</pubDate><guid>tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/</guid></item><item><title>Article 2</title><link>http://blog.notmyidea.org/posts/2011/February/17/article-2/</link><description><p>Article 2</p>
|
||||
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Thu, 17 Feb 2011 00:00:00 +0100</pubDate><guid>tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/</guid></item><item><title>Article 3</title><link>http://blog.notmyidea.org/posts/2011/February/17/article-3/</link><description><p>Article 3</p>
|
||||
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Thu, 17 Feb 2011 00:00:00 +0100</pubDate><guid>tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/</guid></item></channel></rss>
|
||||
38
pelican/tests/output/custom_locale/feeds/misc.atom.xml
Normal file
38
pelican/tests/output/custom_locale/feeds/misc.atom.xml
Normal file
File diff suppressed because one or more lines are too long
38
pelican/tests/output/custom_locale/feeds/misc.rss.xml
Normal file
38
pelican/tests/output/custom_locale/feeds/misc.rss.xml
Normal file
File diff suppressed because one or more lines are too long
14
pelican/tests/output/custom_locale/feeds/yeah.atom.xml
Normal file
14
pelican/tests/output/custom_locale/feeds/yeah.atom.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alexis' log</title><link href="http://blog.notmyidea.org/" rel="alternate"></link><link href="http://blog.notmyidea.org/feeds/yeah.atom.xml" rel="self"></link><id>http://blog.notmyidea.org/</id><updated>2013-11-17T23:29:00+01:00</updated><entry><title>This is a super article !</title><link href="http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/" rel="alternate"></link><updated>2013-11-17T23:29:00+01:00</updated><author><name>Alexis Métaireau</name></author><id>tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/</id><summary type="html"><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">
|
||||
&gt;&gt;&gt; from ipdb import set_trace
|
||||
&gt;&gt;&gt; set_trace()
|
||||
</pre>
|
||||
<p>→ And now try with some utf8 hell: ééé</p>
|
||||
</div>
|
||||
</summary><category term="foo"></category><category term="bar"></category><category term="foobar"></category></entry></feed>
|
||||
14
pelican/tests/output/custom_locale/feeds/yeah.rss.xml
Normal file
14
pelican/tests/output/custom_locale/feeds/yeah.rss.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alexis' log</title><link>http://blog.notmyidea.org/</link><description></description><atom:link href="http://blog.notmyidea.org/feeds/yeah.rss.xml" rel="self"></atom:link><lastBuildDate>Sun, 17 Nov 2013 23:29:00 +0100</lastBuildDate><item><title>This is a super article !</title><link>http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/</link><description><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">
|
||||
&gt;&gt;&gt; from ipdb import set_trace
|
||||
&gt;&gt;&gt; set_trace()
|
||||
</pre>
|
||||
<p>→ And now try with some utf8 hell: ééé</p>
|
||||
</div>
|
||||
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alexis Métaireau</dc:creator><pubDate>Sun, 17 Nov 2013 23:29:00 +0100</pubDate><guid>tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/</guid><category>foo</category><category>bar</category><category>foobar</category></item></channel></rss>
|
||||
Loading…
Add table
Add a link
Reference in a new issue