From 0550c6ef29b2129efe1fbd061669f2909f464559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Fri, 5 Jul 2013 01:08:45 +0200 Subject: [PATCH] add multiple authors --- pelican/contents.py | 14 ++-- pelican/generators.py | 24 +++---- pelican/readers.py | 11 ++-- .../output/basic/author/alexis-metaireau.html | 6 +- pelican/tests/output/basic/category/bar.html | 3 +- pelican/tests/output/basic/category/misc.html | 4 ++ pelican/tests/output/basic/category/yeah.html | 3 +- .../tests/output/basic/feeds/all-en.atom.xml | 4 +- pelican/tests/output/basic/feeds/all.atom.xml | 4 +- .../tests/output/basic/feeds/misc.atom.xml | 4 +- pelican/tests/output/basic/index.html | 10 +-- pelican/tests/output/basic/oh-yeah.html | 3 +- .../tests/output/basic/second-article.html | 4 ++ pelican/tests/output/basic/tag/bar.html | 10 +-- pelican/tests/output/basic/tag/baz.html | 4 ++ pelican/tests/output/basic/tag/foo.html | 7 +- pelican/tests/output/basic/tag/foobar.html | 3 +- pelican/tests/output/basic/tag/oh.html | 3 +- pelican/tests/output/basic/tag/yeah.html | 3 +- .../output/basic/this-is-a-super-article.html | 3 +- .../custom/a-markdown-powered-article.html | 3 +- pelican/tests/output/custom/article-1.html | 3 +- pelican/tests/output/custom/article-2.html | 3 +- pelican/tests/output/custom/article-3.html | 3 +- .../custom/author/alexis-metaireau.html | 14 ++-- .../custom/author/alexis-metaireau2.html | 65 +++++++++---------- .../custom/author/alexis-metaireau3.html | 3 +- pelican/tests/output/custom/category/bar.html | 3 +- .../tests/output/custom/category/cat1.html | 12 ++-- .../tests/output/custom/category/misc.html | 9 +-- .../tests/output/custom/category/yeah.html | 3 +- .../output/custom/drafts/a-draft-article.html | 3 +- .../custom/filename_metadata-example.html | 3 +- pelican/tests/output/custom/index.html | 12 ++-- pelican/tests/output/custom/index2.html | 12 ++-- pelican/tests/output/custom/index3.html | 3 +- pelican/tests/output/custom/oh-yeah-fr.html | 3 +- pelican/tests/output/custom/oh-yeah.html | 3 +- .../output/custom/second-article-fr.html | 3 +- .../tests/output/custom/second-article.html | 3 +- pelican/tests/output/custom/tag/bar.html | 9 +-- pelican/tests/output/custom/tag/baz.html | 3 +- pelican/tests/output/custom/tag/foo.html | 6 +- pelican/tests/output/custom/tag/foobar.html | 3 +- pelican/tests/output/custom/tag/oh.html | 3 +- pelican/tests/output/custom/tag/yeah.html | 3 +- .../custom/this-is-a-super-article.html | 3 +- pelican/tests/output/custom/unbelievable.html | 3 +- .../notmyidea/templates/article_infos.html | 4 +- pelican/themes/simple/templates/index.html | 6 +- samples/content/article2.rst | 1 + 51 files changed, 158 insertions(+), 179 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 1b604f19..b5da4342 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -68,10 +68,16 @@ class Content(object): #default template if it's not defined in page self.template = self._get_template() - # default author to the one in settings if not defined - if not hasattr(self, 'author'): - if 'AUTHOR' in settings: - self.author = Author(settings['AUTHOR'], settings) + # First, read the authors from "authors", if not, fallback to "author" + # and if not use the settings defined one, if any. + if not hasattr(self, 'author') and 'AUTHOR' in settings: + self.author = Author(settings['AUTHOR'], settings) + + if not hasattr(self, 'authors') and hasattr(self, 'author'): + setattr(self, 'authors', [self.author]) + + if hasattr(self, 'authors') and not hasattr(self, 'author'): + setattr(self, 'author', self.authors[0]) # XXX Split all the following code into pieces, there is too much here. diff --git a/pelican/generators.py b/pelican/generators.py index 0dc3667f..f8b7ede7 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -22,7 +22,6 @@ from pelican.contents import Article, Page, Static, is_valid_content from pelican.readers import read_file from pelican.utils import copy, process_translations, mkdir_p, DateFormatter from pelican import signals -import pelican.utils logger = logging.getLogger(__name__) @@ -286,16 +285,16 @@ class ArticlesGenerator(Generator): dates=archive, blog=True) period_save_as = { - 'year' : self.settings['YEAR_ARCHIVE_SAVE_AS'], - 'month': self.settings['MONTH_ARCHIVE_SAVE_AS'], - 'day' : self.settings['DAY_ARCHIVE_SAVE_AS'], - } + 'year': self.settings['YEAR_ARCHIVE_SAVE_AS'], + 'month': self.settings['MONTH_ARCHIVE_SAVE_AS'], + 'day': self.settings['DAY_ARCHIVE_SAVE_AS'], + } period_date_key = { - 'year' : attrgetter('date.year'), - 'month': attrgetter('date.year', 'date.month'), - 'day' : attrgetter('date.year', 'date.month', 'date.day') - } + 'year': attrgetter('date.year'), + 'month': attrgetter('date.year', 'date.month'), + 'day': attrgetter('date.year', 'date.month', 'date.day') + } for period in 'year', 'month', 'day': save_as = period_save_as[period] @@ -418,9 +417,10 @@ class ArticlesGenerator(Generator): for tag in article.tags: self.tags[tag].append(article) # ignore blank authors as well as undefined - if hasattr(article, 'author') and article.author.name != '': - self.authors[article.author].append(article) - + if hasattr(article, 'authors'): + for author in article.authors: + if author.name != '': + self.authors[author].append(article) # sort the articles by date self.articles.sort(key=attrgetter('date'), reverse=True) diff --git a/pelican/readers.py b/pelican/readers.py index bd9f5914..f6140525 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -27,7 +27,7 @@ except ImportError: try: from html import escape except ImportError: - from cgi import escape + from cgi import escape # NOQA try: from html.parser import HTMLParser except ImportError: @@ -45,6 +45,7 @@ METADATA_PROCESSORS = { 'status': lambda x, y: x.strip(), 'category': Category, 'author': Author, + 'authors': lambda x, y: [Author(name, y) for name in x.split(',')], } @@ -449,13 +450,13 @@ def parse_path_metadata(source_path, settings=None, process=None): subdir = os.path.basename(dirname) if settings: checks = [] - for key,data in [('FILENAME_METADATA', base), - ('PATH_METADATA', source_path), - ]: + for key, data in [('FILENAME_METADATA', base), + ('PATH_METADATA', source_path), + ]: checks.append((settings.get(key, None), data)) if settings.get('USE_FOLDER_AS_CATEGORY', None): checks.insert(0, ('(?P.*)', subdir)) - for regexp,data in checks: + for regexp, data in checks: if regexp and data: match = re.match(regexp, data) if match: diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html index 7f7a8c6b..4c0321ad 100644 --- a/pelican/tests/output/basic/author/alexis-metaireau.html +++ b/pelican/tests/output/basic/author/alexis-metaireau.html @@ -35,8 +35,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

@@ -67,8 +66,7 @@ YEAH !

- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Multi-line metadata should be supported diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html index 9e3b52f1..6414bf7b 100644 --- a/pelican/tests/output/basic/category/bar.html +++ b/pelican/tests/output/basic/category/bar.html @@ -35,8 +35,7 @@

- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html index af223812..c0722292 100644 --- a/pelican/tests/output/basic/category/misc.html +++ b/pelican/tests/output/basic/category/misc.html @@ -58,6 +58,10 @@ Wed 29 February 2012 +
+ By babar + +celestine

In misc.

tags: foobarbaz

Translations: fr diff --git a/pelican/tests/output/basic/category/yeah.html b/pelican/tests/output/basic/category/yeah.html index f401e3d2..3e61d850 100644 --- a/pelican/tests/output/basic/category/yeah.html +++ b/pelican/tests/output/basic/category/yeah.html @@ -35,8 +35,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Some content here !

diff --git a/pelican/tests/output/basic/feeds/all-en.atom.xml b/pelican/tests/output/basic/feeds/all-en.atom.xml index 54c87905..d4be1694 100644 --- a/pelican/tests/output/basic/feeds/all-en.atom.xml +++ b/pelican/tests/output/basic/feeds/all-en.atom.xml @@ -1,6 +1,8 @@ A Pelican Blog/2012-11-30T00:00:00ZFILENAME_METADATA example2012-11-30T00:00:00Ztag:,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> +Second article2012-02-29T00:00:00Zbabar + +celestinetag:,2012-02-29:second-article.html<p>This is some article, in english</p> A markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> <p><a href="/unbelievable.html">a root-relative link to unbelievable</a> <a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> diff --git a/pelican/tests/output/basic/feeds/all.atom.xml b/pelican/tests/output/basic/feeds/all.atom.xml index 3081adc6..b3bbd8d8 100644 --- a/pelican/tests/output/basic/feeds/all.atom.xml +++ b/pelican/tests/output/basic/feeds/all.atom.xml @@ -1,6 +1,8 @@ A Pelican Blog/2012-11-30T00:00:00ZFILENAME_METADATA example2012-11-30T00:00:00Ztag:,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> +Second article2012-02-29T00:00:00Zbabar + +celestinetag:,2012-02-29:second-article.html<p>This is some article, in english</p> Deuxième article2012-02-29T00:00:00Ztag:,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> A markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> <p><a href="/unbelievable.html">a root-relative link to unbelievable</a> diff --git a/pelican/tests/output/basic/feeds/misc.atom.xml b/pelican/tests/output/basic/feeds/misc.atom.xml index e71bd151..0c0044f6 100644 --- a/pelican/tests/output/basic/feeds/misc.atom.xml +++ b/pelican/tests/output/basic/feeds/misc.atom.xml @@ -1,6 +1,8 @@ A Pelican Blog/2012-11-30T00:00:00ZFILENAME_METADATA example2012-11-30T00:00:00Ztag:,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> +Second article2012-02-29T00:00:00Zbabar + +celestinetag:,2012-02-29:second-article.html<p>This is some article, in english</p> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index c5b9fec3..cbc3597f 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -58,6 +58,10 @@ Wed 29 February 2012 +
+ By babar + +celestine

In misc.

tags: foobarbaz

Translations: fr @@ -172,8 +176,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Multi-line metadata should be supported @@ -198,8 +201,7 @@ as well as inline markup.

- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html index 62834917..9c2ca876 100644 --- a/pelican/tests/output/basic/oh-yeah.html +++ b/pelican/tests/output/basic/oh-yeah.html @@ -38,8 +38,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

diff --git a/pelican/tests/output/basic/second-article.html b/pelican/tests/output/basic/second-article.html index 6cc42c66..8f04a4e5 100644 --- a/pelican/tests/output/basic/second-article.html +++ b/pelican/tests/output/basic/second-article.html @@ -37,6 +37,10 @@ Wed 29 February 2012 +
+ By babar + +celestine

In misc.

tags: foobarbaz

Translations: fr diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html index 20824993..f0179152 100644 --- a/pelican/tests/output/basic/tag/bar.html +++ b/pelican/tests/output/basic/tag/bar.html @@ -34,6 +34,10 @@ Wed 29 February 2012 +
+ By babar + +celestine

In misc.

tags: foobarbaz

Translations: fr @@ -61,8 +65,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Multi-line metadata should be supported @@ -87,8 +90,7 @@ as well as inline markup.

- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html index 65632313..912f0d97 100644 --- a/pelican/tests/output/basic/tag/baz.html +++ b/pelican/tests/output/basic/tag/baz.html @@ -34,6 +34,10 @@ Wed 29 February 2012 +
+ By babar + +celestine

In misc.

tags: foobarbaz

Translations: fr diff --git a/pelican/tests/output/basic/tag/foo.html b/pelican/tests/output/basic/tag/foo.html index 05a02a5f..f1aa7fb1 100644 --- a/pelican/tests/output/basic/tag/foo.html +++ b/pelican/tests/output/basic/tag/foo.html @@ -34,6 +34,10 @@ Wed 29 February 2012 +
+ By babar + +celestine

In misc.

tags: foobarbaz

Translations: fr @@ -61,8 +65,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Multi-line metadata should be supported diff --git a/pelican/tests/output/basic/tag/foobar.html b/pelican/tests/output/basic/tag/foobar.html index c683f1a1..24d5e21d 100644 --- a/pelican/tests/output/basic/tag/foobar.html +++ b/pelican/tests/output/basic/tag/foobar.html @@ -35,8 +35,7 @@

- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Some content here !

diff --git a/pelican/tests/output/basic/tag/oh.html b/pelican/tests/output/basic/tag/oh.html index 610a7aa3..e4da0f93 100644 --- a/pelican/tests/output/basic/tag/oh.html +++ b/pelican/tests/output/basic/tag/oh.html @@ -35,8 +35,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

diff --git a/pelican/tests/output/basic/tag/yeah.html b/pelican/tests/output/basic/tag/yeah.html index 2afb8bd3..e3c3a1c6 100644 --- a/pelican/tests/output/basic/tag/yeah.html +++ b/pelican/tests/output/basic/tag/yeah.html @@ -35,8 +35,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

diff --git a/pelican/tests/output/basic/this-is-a-super-article.html b/pelican/tests/output/basic/this-is-a-super-article.html index 617b8c6d..e65f37e3 100644 --- a/pelican/tests/output/basic/this-is-a-super-article.html +++ b/pelican/tests/output/basic/this-is-a-super-article.html @@ -38,8 +38,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In yeah.

tags: foobarfoobar

Some content here !

diff --git a/pelican/tests/output/custom/a-markdown-powered-article.html b/pelican/tests/output/custom/a-markdown-powered-article.html index 7b953a61..6fbb116f 100644 --- a/pelican/tests/output/custom/a-markdown-powered-article.html +++ b/pelican/tests/output/custom/a-markdown-powered-article.html @@ -42,8 +42,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

You're mutually oblivious.

diff --git a/pelican/tests/output/custom/article-1.html b/pelican/tests/output/custom/article-1.html index c52fdd9a..38d0efb5 100644 --- a/pelican/tests/output/custom/article-1.html +++ b/pelican/tests/output/custom/article-1.html @@ -42,8 +42,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

Article 1

diff --git a/pelican/tests/output/custom/article-2.html b/pelican/tests/output/custom/article-2.html index 7a045bdc..cf7d3f6a 100644 --- a/pelican/tests/output/custom/article-2.html +++ b/pelican/tests/output/custom/article-2.html @@ -42,8 +42,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

Article 2

diff --git a/pelican/tests/output/custom/article-3.html b/pelican/tests/output/custom/article-3.html index f887218c..da73f06f 100644 --- a/pelican/tests/output/custom/article-3.html +++ b/pelican/tests/output/custom/article-3.html @@ -42,8 +42,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

Article 3

diff --git a/pelican/tests/output/custom/author/alexis-metaireau.html b/pelican/tests/output/custom/author/alexis-metaireau.html index f18b8ce8..7dcfc87e 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau.html +++ b/pelican/tests/output/custom/author/alexis-metaireau.html @@ -39,8 +39,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

You're mutually oblivious.

@@ -67,8 +66,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

Article 1

@@ -92,8 +90,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

Article 2

@@ -117,8 +114,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In cat1.

Article 3

@@ -128,7 +124,7 @@

- Page 1 / 3 + Page 1 / 2 »

diff --git a/pelican/tests/output/custom/author/alexis-metaireau2.html b/pelican/tests/output/custom/author/alexis-metaireau2.html index 9f4a31e8..40fc46f9 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau2.html +++ b/pelican/tests/output/custom/author/alexis-metaireau2.html @@ -46,8 +46,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In misc.

Some cool stuff!

@@ -71,8 +70,7 @@
- By Alexis Métaireau -
+ By Alexis Métaireau

In bar.

tags: ohbaryeah

Translations: fr @@ -90,33 +88,6 @@ YEAH !

-
  • - - -
  • + + + +
  • « - Page 2 / 3 - » + Page 2 / 2

    diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index 4eda0b62..1966b99a 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -46,8 +46,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Or completely awesome. Depends the needs.

    diff --git a/pelican/tests/output/custom/category/bar.html b/pelican/tests/output/custom/category/bar.html index f7f1bbf3..24bd7d5e 100644 --- a/pelican/tests/output/custom/category/bar.html +++ b/pelican/tests/output/custom/category/bar.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In bar.

    tags: ohbaryeah

    Translations: fr diff --git a/pelican/tests/output/custom/category/cat1.html b/pelican/tests/output/custom/category/cat1.html index 10c4ce76..2a9af66d 100644 --- a/pelican/tests/output/custom/category/cat1.html +++ b/pelican/tests/output/custom/category/cat1.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    You're mutually oblivious.

    @@ -67,8 +66,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    Article 1

    @@ -92,8 +90,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    Article 2

    @@ -117,8 +114,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    Article 3

    diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index 121c9451..d815aa44 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Some cool stuff!

    @@ -66,8 +65,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: fr @@ -93,8 +91,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Or completely awesome. Depends the needs.

    diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index f7cc8d12..452a5c44 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In yeah.

    tags: foobarfoobar

    Some content here !

    diff --git a/pelican/tests/output/custom/drafts/a-draft-article.html b/pelican/tests/output/custom/drafts/a-draft-article.html index 493eb611..af9b0620 100644 --- a/pelican/tests/output/custom/drafts/a-draft-article.html +++ b/pelican/tests/output/custom/drafts/a-draft-article.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    This is a draft article, it should live under the /drafts/ folder and not be diff --git a/pelican/tests/output/custom/filename_metadata-example.html b/pelican/tests/output/custom/filename_metadata-example.html index 626e8c64..65b42d7f 100644 --- a/pelican/tests/output/custom/filename_metadata-example.html +++ b/pelican/tests/output/custom/filename_metadata-example.html @@ -42,8 +42,7 @@

    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Some cool stuff!

    diff --git a/pelican/tests/output/custom/index.html b/pelican/tests/output/custom/index.html index 1a1d89e9..1b084d49 100644 --- a/pelican/tests/output/custom/index.html +++ b/pelican/tests/output/custom/index.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Some cool stuff!

    @@ -66,8 +65,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: fr @@ -93,8 +91,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    You're mutually oblivious.

    @@ -119,8 +116,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    Article 1

    diff --git a/pelican/tests/output/custom/index2.html b/pelican/tests/output/custom/index2.html index b8e2ac1a..52f0ecc6 100644 --- a/pelican/tests/output/custom/index2.html +++ b/pelican/tests/output/custom/index2.html @@ -46,8 +46,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    Article 2

    @@ -71,8 +70,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In cat1.

    Article 3

    @@ -96,8 +94,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In yeah.

    tags: foobarfoobar

    Multi-line metadata should be supported @@ -122,8 +119,7 @@ as well as inline markup.

    - By Alexis Métaireau -
    + By Alexis Métaireau

    In bar.

    tags: ohbaryeah

    Translations: fr diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index cf285ea2..d0e537ba 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -46,8 +46,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Or completely awesome. Depends the needs.

    diff --git a/pelican/tests/output/custom/oh-yeah-fr.html b/pelican/tests/output/custom/oh-yeah-fr.html index e34e6078..9d2a764a 100644 --- a/pelican/tests/output/custom/oh-yeah-fr.html +++ b/pelican/tests/output/custom/oh-yeah-fr.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Translations: en diff --git a/pelican/tests/output/custom/oh-yeah.html b/pelican/tests/output/custom/oh-yeah.html index 2f6ca309..04db2171 100644 --- a/pelican/tests/output/custom/oh-yeah.html +++ b/pelican/tests/output/custom/oh-yeah.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In bar.

    tags: ohbaryeah

    Translations: fr diff --git a/pelican/tests/output/custom/second-article-fr.html b/pelican/tests/output/custom/second-article-fr.html index 3d5fbd29..9021cdc1 100644 --- a/pelican/tests/output/custom/second-article-fr.html +++ b/pelican/tests/output/custom/second-article-fr.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: en diff --git a/pelican/tests/output/custom/second-article.html b/pelican/tests/output/custom/second-article.html index be83983e..d0430d53 100644 --- a/pelican/tests/output/custom/second-article.html +++ b/pelican/tests/output/custom/second-article.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: fr diff --git a/pelican/tests/output/custom/tag/bar.html b/pelican/tests/output/custom/tag/bar.html index d1805e50..f9896c5e 100644 --- a/pelican/tests/output/custom/tag/bar.html +++ b/pelican/tests/output/custom/tag/bar.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: fr @@ -68,8 +67,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In yeah.

    tags: foobarfoobar

    Multi-line metadata should be supported @@ -94,8 +92,7 @@ as well as inline markup.

    - By Alexis Métaireau -
    + By Alexis Métaireau

    In bar.

    tags: ohbaryeah

    Translations: fr diff --git a/pelican/tests/output/custom/tag/baz.html b/pelican/tests/output/custom/tag/baz.html index a6d23907..df7dc92c 100644 --- a/pelican/tests/output/custom/tag/baz.html +++ b/pelican/tests/output/custom/tag/baz.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: fr diff --git a/pelican/tests/output/custom/tag/foo.html b/pelican/tests/output/custom/tag/foo.html index 04cb7529..3daf7c68 100644 --- a/pelican/tests/output/custom/tag/foo.html +++ b/pelican/tests/output/custom/tag/foo.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    tags: foobarbaz

    Translations: fr @@ -68,8 +67,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In yeah.

    tags: foobarfoobar

    Multi-line metadata should be supported diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index 2c50c8ae..9184e3dd 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -39,8 +39,7 @@

    - By Alexis Métaireau -
    + By Alexis Métaireau

    In yeah.

    tags: foobarfoobar

    Some content here !

    diff --git a/pelican/tests/output/custom/tag/oh.html b/pelican/tests/output/custom/tag/oh.html index b798964e..901fe9ff 100644 --- a/pelican/tests/output/custom/tag/oh.html +++ b/pelican/tests/output/custom/tag/oh.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In bar.

    tags: ohbaryeah

    Translations: fr diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index 54ad93c6..d12788e0 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -39,8 +39,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In bar.

    tags: ohbaryeah

    Translations: fr diff --git a/pelican/tests/output/custom/this-is-a-super-article.html b/pelican/tests/output/custom/this-is-a-super-article.html index 1fdd8897..5b1b1485 100644 --- a/pelican/tests/output/custom/this-is-a-super-article.html +++ b/pelican/tests/output/custom/this-is-a-super-article.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In yeah.

    tags: foobarfoobar

    Some content here !

    diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index e7253497..d06dcb9e 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -42,8 +42,7 @@
    - By Alexis Métaireau -
    + By Alexis Métaireau

    In misc.

    Or completely awesome. Depends the needs.

    diff --git a/pelican/themes/notmyidea/templates/article_infos.html b/pelican/themes/notmyidea/templates/article_infos.html index 4b86716d..8097b5d6 100644 --- a/pelican/themes/notmyidea/templates/article_infos.html +++ b/pelican/themes/notmyidea/templates/article_infos.html @@ -3,9 +3,9 @@ {{ article.locale_date }} - {% if article.author %} + {% if article.authors %}
    - By {{ article.author }} + By {% for author in article.authors %} {{ article.author }} {% endfor %}
    {% endif %}

    In {{ article.category }}. {% if PDF_PROCESSOR %}get the pdf{% endif %}

    diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index 5bb94dfc..8593cec5 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -11,7 +11,11 @@

    {{ article.title }}

    {{ article.summary }}
    diff --git a/samples/content/article2.rst b/samples/content/article2.rst index 66f768ea..d07ddc8e 100644 --- a/samples/content/article2.rst +++ b/samples/content/article2.rst @@ -5,5 +5,6 @@ Second article :date: 2012-02-29 :lang: en :slug: second-article +:authors: babar, celestine This is some article, in english