-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Some themes using "loop" throw a critical error when creating the blog #481
Comments
Hi Tomke. As mentioned in the Getting Help section of the docs, please test with the default "notmyidea" theme. Assuming you don't see the error with that theme, try comparing that theme's source to ones where you get the error and see if you can determine the difference that's causing the problem. Thanks for helping to track this down! |
Sure, sorry, should have thought of including that info. I can use the notmyidea theme from the pelican repo as well as several others from this repo (working examples are bootstrap2-dark, Flex and Medius). I first thought all themes containing the loop keyword did not work (like line 8 here). But I just saw that the notmyidea theme from the pelican repo also uses My python is a little rusty, so I wonder where loop comes from in the template mentioned above. But I went ahead and removed all loop instances from the nmnlist theme (index.html and base.html), the resulting files are in this little gist. I first suspected some problem with wrong python versions, but I tested this on Manjaro Linux, Linux Mint and an Ubuntu Server. Letme know what else you need. |
@MrMovl The error is not because of line 8 in that file but rather line 28. It tries to use loop variable outside of for loop. loop variable comes from inside of Jinja2 engine. Proper fix instead of removing every occurrence of loop variable can look like this:
|
Thanks for the helpful tip, Piotrek. Much appreciated! |
Hi, I'm having a similar problem. When I try to use pelican-bootstrap3, it returns the following error: CRITICAL: UndefinedError: '_' is undefined I have tested the default (notmyidea) theme and it works great. Also, like MrMovl, bootstrap2-dark and medius work just fine as well. I'm not sure if the code you posted would work in my situation and I'm unsure where to copy that code. Any help would be greatly appreciated! |
@kmannarbor: |
@kmannarbor probably related to #460 |
Hi there, this one is kind of strange. A lot of themes are broken for me, in fact, every theme which uses "loop" somewhere in any template. Even in 4 year old themes. I am not sure if I have a strange setup, but I don't think so.
Basically, if I add the following line to my pelicanconf.py
THEME = "/home/me/workspace/pelican-themes/nmnlist"
and then run the build with
make html
I get the following error:CRITICAL: UndefinedError: 'loop' is undefined
Makefile:65: recipe for target 'html' failed
make: *** [html] Error 1
I also get that error when building manually using
pelican content -o output -s pelicanconf.py
Maybe this has a simple solution, but I was not able to find anything.
The project I used here is not much more then what
pelican quickstart
generates, except two about me articles (in two languages).Let me know if any additional info is necessary.
The text was updated successfully, but these errors were encountered: