summaryrefslogtreecommitdiff
path: root/pelican/generators.py
diff options
context:
space:
mode:
authorAlexis Métaireau <alexis@notmyidea.org>2013-07-05 01:08:45 +0200
committerAlexis Métaireau <alexis@notmyidea.org>2013-07-05 01:08:45 +0200
commit0550c6ef29b2129efe1fbd061669f2909f464559 (patch)
tree352cde8243600fe4fc48c863f4229ae0019cb156 /pelican/generators.py
parent7ec4d5faa25040f6cabcf2ddbab58b19c4b77a2c (diff)
downloadpelican-multiple-authors.tar.gz
add multiple authorsmultiple-authors
Diffstat (limited to 'pelican/generators.py')
-rw-r--r--pelican/generators.py24
1 files changed, 12 insertions, 12 deletions
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)