Open mpounsett opened 1 year ago
@mpounsett I'm so sorry I ignored this error for so long. Would you be able to provide a GH repo with a minimal example of the situation? This way it will be very easy to debug. Thanks, and again so sorry for the delay.
This is similar to #18, although the specifics I'm seeing are slightly different than what was described there.
I've got a draft article with my first series in it.. and just added series support to my theme. My
pelicanconf.py
defines DEFAULT_METADATA of"status": "published"
for development purposes, andpublishconf.py
sets that default todraft
. This is the setup I use so that the devserver will show me draft articles as they will appear once published. My uses ofpelican-series
worked fine in this setup until I tried to do a producton publish of a new article, while the unfinished series article is still in drafts.When Pelican's
make publish
target hits that draft article, it fails. The first encountered error is a reference toarticle.series.previous.url
:The error comes from this bit of template in my
article.html
:That block is itself wrapped in an if to check whether the article is part of a series:
The draft in question is the first and only article in the series, so
article.series.next
andarticle.series.previous
should both beNone
. I've done some strategic commenting-out of bits of the template and inserting values as comments to determine thatarticle.series.previous
actually referencesarticle.series.name
in a draft, rather thanarticle.series.all_previous[-1]
, as it does when the article is published.Oddly,
article.series.index
andarticle.series.name
both seem to be empty string when the document is a draft, but work as expected when the document is published.Relevant software version info from my virtualenv: