kdeldycke/plumage

Crashes when devserver is deployed

Closed this issue · 3 comments

I have an empty pelican site and after installing the plumage theme the devserver crashes when I launch it. Below is the error that is printed. Thoughts?

Starting up Pelican and pelican.server
DEBUG: Adding current directory to system path
DEBUG: Temporarily adding PLUGIN_PATH to system path
DEBUG: Restoring system path
  --- AutoReload Mode: Monitoring `content`, `theme` and `settings` for changes. ---
DEBUG: Temporarily adding PLUGIN_PATH to system path
DEBUG: Restoring system path

-> Modified: theme, settings. re-generating...
WARNING: No valid files found in content.
DEBUG: template list: [u'!simple/archives.html', u'!simple/article.html', u'!simple/author.html', u'!simple/base.html', u'!simple/categories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/index.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.html', u'archives.html', u'article.html', u'author.html', u'base.html', u'categories.html', u'category.html', u'gosquared.html', u'index.html', u'macros.html', u'page.html', u'pagination.html', u'projects.html', u'tag.html', u'tags.html', u'translations.html']
DEBUG: template list: [u'!simple/archives.html', u'!simple/article.html', u'!simple/author.html', u'!simple/base.html', u'!simple/categories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/index.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.html', u'archives.html', u'article.html', u'author.html', u'base.html', u'categories.html', u'category.html', u'gosquared.html', u'index.html', u'macros.html', u'page.html', u'pagination.html', u'projects.html', u'tag.html', u'tags.html', u'translations.html']
DEBUG: template list: [u'!simple/archives.html', u'!simple/article.html', u'!simple/author.html', u'!simple/base.html', u'!simple/categories.html', u'!simple/category.html', u'!simple/gosquared.html', u'!simple/index.html', u'!simple/page.html', u'!simple/pagination.html', u'!simple/tag.html', u'!simple/tags.html', u'!simple/translations.html', u'archives.html', u'article.html', u'author.html', u'base.html', u'categories.html', u'category.html', u'gosquared.html', u'index.html', u'macros.html', u'page.html', u'pagination.html', u'projects.html', u'tag.html', u'tags.html', u'translations.html']
serving at port 8000
-> replacement of /Users/nolan/anaconda/lib/python2.7/site-packages/pelican/themes/plumage/static with /Users/nolan/PycharmProjects/nicholsn.github.io/output/theme
CRITICAL: ('list object has no element 0',)
Pelican and pelican.server processes now running in background.
CRITICAL: list object has no element 0
Traceback (most recent call last):
  File "/Users/nolan/anaconda/bin/pelican", line 9, in <module>
    load_entry_point('pelican==3.2.2', 'console_scripts', 'pelican')()
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/__init__.py", line 354, in main
    pelican.run()
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/__init__.py", line 181, in run
    p.generate_output(writer)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/generators.py", line 494, in generate_output
    self.generate_pages(writer)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/generators.py", line 367, in generate_pages
    self.generate_direct_templates(write)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/generators.py", line 317, in generate_direct_templates
    page_name=os.path.splitext(save_as)[0])
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/writers.py", line 169, in write_file
    paginated_name)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/writers.py", line 116, in _write_file
    output = template.render(localcontext)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/themes/plumage/templates/index.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/pelican/themes/plumage/templates/base.html", line 206, in top-level template code
    <p>© Copyright {{ dates[0].date.year }} {{ AUTHOR }}.</p>
  File "/Users/nolan/anaconda/lib/python2.7/site-packages/jinja2/environment.py", line 397, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: list object has no element 0

@nicholsn: you had this issue because you didn't had any articles yet in your pristine Pelican site right ? In this case I just fixed the issue.

thanks for the fix, also after adding content the current version works and looks great!

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.