Closed paternal closed 6 years ago
Thanks for finding this, and sorry for the bug. The error is definitely something in this code. I think I left something out when constructing the context (as the error says). Once fixed there should be a test for this as well.
This should be fixed now (and tests written) in 0.4.1 that I just released.
Great! It works. Now I can ditch this poorly designed, quickly written, badly broken extension that I wrote and replace it with jinja2 macros and filters. Thanks!
When I use the
url
filter, I get a python exception :RuntimeError: No context found
.How to reproduce bug
"Quickstart" a blog.
Besides the project name, only use the default values
lektor quickstart
"cd" to the project directory
Install this plugin
lektor plugins add jinja-content
Add the following line to
content/contents.lr
1 + 2 is {{ 1 + 2 }}
This is rendered (as HTML) as :
1 + 2 is 3
. Great! It works.Add the following line to
content/contents.lr
(which is given in this project README) :[link text]({{ this|url }})
Compilation fails, with the following exception:
Environment
Everything is done inside a virtualenv (which, I know, is discouraged, but I do not think it is the cause of the issue here), on Debian testing (buster).