From 79576f25b62c8a520e603d8677c31927220f53b3 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Wed, 5 Jan 2011 16:22:52 +0100 Subject: [PATCH] Fix translation feature. Add translation support to the notmyidea theme. --- pelican/contents.py | 2 +- .../themes/notmyidea/templates/article.html | 13 +-------- .../notmyidea/templates/article_infos.html | 14 ++++++++++ pelican/themes/notmyidea/templates/index.html | 27 ++----------------- .../notmyidea/templates/translations.html | 6 +++++ pelican/utils.py | 1 + samples/content/another_super_article-fr.rst | 6 +++++ samples/content/another_super_article.rst | 2 +- samples/content/super_article.rst | 2 +- 9 files changed, 33 insertions(+), 40 deletions(-) create mode 100644 pelican/themes/notmyidea/templates/article_infos.html create mode 100644 pelican/themes/notmyidea/templates/translations.html create mode 100644 samples/content/another_super_article-fr.rst diff --git a/pelican/contents.py b/pelican/contents.py index dd39fe28..b6e71b75 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -16,7 +16,7 @@ class Page(object): self.status = "published" # default value for key, value in metadatas.items(): - setattr(self, key, value) + setattr(self, key.lower(), value) if not hasattr(self, 'author'): if 'AUTHOR' in settings: diff --git a/pelican/themes/notmyidea/templates/article.html b/pelican/themes/notmyidea/templates/article.html index 8b5e5bae..14fffe4d 100644 --- a/pelican/themes/notmyidea/templates/article.html +++ b/pelican/themes/notmyidea/templates/article.html @@ -7,18 +7,7 @@ rel="bookmark" title="Permalink to {{ article.title }}">{{ article.title }} {% include 'twitter.html' %}
- + {% include 'article_infos.html' %} {{ article.content }}
{% if DISQUS_SITENAME %} diff --git a/pelican/themes/notmyidea/templates/article_infos.html b/pelican/themes/notmyidea/templates/article_infos.html new file mode 100644 index 00000000..818b5277 --- /dev/null +++ b/pelican/themes/notmyidea/templates/article_infos.html @@ -0,0 +1,14 @@ + diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index e6e7d816..5969e6c8 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -7,19 +7,7 @@