Closed jvanasco closed 1 year ago
actually this doesn't work correctly yet. missing a field will not cause an error, but will disable the jinja2 rendering of the content. back to work!
If you get to fixing this before someone else does, please open a new PR. Thanks!
This is a potential fix for issue #13 along with a test case that does not raise an error on building the page (i'm not sure how to otherwise test)
The issue seemed to be an empty field being passed into
process_field
/render_as_jinja
, which then triggered ajinja2.runtime.Undefined
exception for the field. The package otherwise tests for ajinja2.exceptions.UndefinedError
which is raised in other contexts.I am not extremely familiar with jinja2/lektor so I am not sure if this approach will break more things than it fixes. It does not seem to though.