summaryrefslogtreecommitdiff
path: root/pelican/contents.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/contents.py
parent7ec4d5faa25040f6cabcf2ddbab58b19c4b77a2c (diff)
downloadpelican-multiple-authors.tar.gz
add multiple authorsmultiple-authors
Diffstat (limited to 'pelican/contents.py')
-rw-r--r--pelican/contents.py14
1 files changed, 10 insertions, 4 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.