Skip to content

Error when building CRITICAL: 'pelican.contents.Article object' has no attribute 'include' #2910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
jitsejan opened this issue Aug 7, 2021 · 2 comments
Closed
2 tasks done
Labels

Comments

@jitsejan
Copy link

jitsejan commented Aug 7, 2021

  • I have read the Filing Issues and subsequent “How to Get Help” sections of the documentation.
  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • OS version and name: Mac 10.15.7
  • Python version: 3.7.10
  • Pelican version: 4.6.0
  • Link to theme:
  • Links to plugins:
  • Link to your site:
  • Link to your source: https://github.com/jitsejan/jitsejan.com
  • Link to a Gist with the contents of your settings file:

Issue

Pelican was building fine last time I rebuild my website but now got this error all of a sudden. Looks like there is something wrong with the model and I might have defined something in my Markdown files that's not allowed but haven't been able to point out where the mistake is.

I am using 3.7.10 locally as well as on the CloudFlare worker where my site gets generated.

@jitsejan jitsejan added the bug label Aug 7, 2021
@avaris
Copy link
Member

avaris commented Aug 8, 2021

Error is from the theme, here specifically. It expects a include metadata/attribute on articles. That's not default. So presumably it comes from a plugin or actual metadata. Or maybe it was never there and it seems to "work" in Jinja2==2.11.3. I think Jinja2==3.x made it more strict and raises errors for foo in Undefined now. So I'd suggest guarding against that:

{% if article.include and 'angular' in article.include %}

@jitsejan
Copy link
Author

jitsejan commented Sep 8, 2021

Apologies for the (slight) delay. You are right and fixing the Jinja version the build is fine. Thanks!

@jitsejan jitsejan closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants