1
0
Fork 0
forked from github/pelican

So that Authors display and output can be disabled for single user sites, allow the AUTHOR setting to be set to an empty string ''.

An author is needed, but was defaults to OS user, or 'John Doe'. If a blank author is provided, it generated authors/.html file, and templates display just "by "
Updated generators.py and templates to ignore Authors objects which have a blank name
This commit is contained in:
Brendan Wholihan 2012-10-18 19:55:00 +01:00
commit 94877e033b
4 changed files with 9 additions and 8 deletions

View file

@ -223,11 +223,12 @@ class ArticlesGenerator(Generator):
"""Generate Author pages."""
author_template = self.get_template('author')
for aut, articles in self.authors:
dates = [article for article in self.dates if article in articles]
write(aut.save_as, author_template, self.context,
author=aut, articles=articles, dates=dates,
paginated={'articles': articles, 'dates': dates},
page_name=u'author/%s' % aut)
if aut.name: # ignore authors with blank names
dates = [article for article in self.dates if article in articles]
write(aut.save_as, author_template, self.context,
author=aut, articles=articles, dates=dates,
paginated={'articles': articles, 'dates': dates},
page_name=u'author/%s' % aut)
def generate_drafts(self, write):
"""Generate drafts pages."""