Closed antonmosich closed 2 years ago
Anton, thanks for the issue, I will look into it as soon as possible! Have a good day
Hi @antonmosich, a question just to clarify the use case. Shall the blog contain only 1 article (the draft one) or is it enough to have one of the articles with that specific combination of features? Thanks
It should work with any blog containing an article which is a draft and has a series tag.
@antonmosich I'm sorry but I can't reproduce it. I took a series of 5 posts and marked the 5th post with Status: draft
. I put in the template the following code
<p>{{ article.series.all }}</p>
and I got the error
[16:29:07] WARNING Caught exception: log.py:91
"'pelican.contents.Article object' has no attribute 'series'".
which is why I suggested using {% if article.series %}
.
Can you please provide a minimal reproducible example? Thanks
You're right. I couldn't reproduce the issue either, which confuses me a lot, as I had that problem while setting up my blog. Sadly I did not use a VCS while setting that up, so I can't reproduce the state my blog was at while encountering the issue exactly... I don't know the exactly how pelican works internally, could it be that another plugin interfered with series, causing the series tag to be accessible as a string for jinja? I'm sorry. I should've better documented my issue when I had it :(
Do not worry! I'm not sure if another plugin might produce that effect. I will test a bit more with a fresh blog and see if I can reproduce the problem.
@antonmosich I tried different configurations but wasn't able to reproduce this. For now I will close it, feel free to reopen it if you manage to find the configuration that produces the bug. Thanks!
If you have an article that has both a Series tag as well as the
Status: draft
set, and thearticle.html
makes use of e.g.article.series.all
, pelican will throw an error:That happens even though I used the
{% if article.series %}
that is used in the README. That is mostly a documentation problem in my opinion, as you could just change the template to{% if article.series and article.series.all %}
or any variation of that.