Closed wdmtech closed 6 years ago
I can replicate this using the repo by @wernerglinka:
https://github.com/wernerglinka/minms
and modifying the following line
to:
<h1>{{ default(title, 'missing title') }}</h1>
Maybe it's the default()
function (and my inexperience with Nunjucks!)
I've discovered you can write:
{{ variable or 'default text' }}
Instead. And filters seem to work... 🤔
Anyway, I'm going to keep investigating for now.
@wdmtech I typically get this error when I misspell something or use a wrong variable name.
This might explain it: https://github.com/mozilla/nunjucks/issues/569
Thanks @wernerglinka, this seems to reflect my experience
I'll close this for now as it seems to be a problem with Nunjucks
Hi!
I have a very typical nunjucks setup on Metalsmith
I can output variables, and overwrite blocks in child templates:
but as soon as I want to do something like:
I get the following error:
The message is a bit vague to me - I though I was doing things synchronously?
Does anyone have any experience with this error?
I've looked around all afternoon and I can't find much except this SO post:
https://stackoverflow.com/questions/49799507/using-nunjucks-includes-with-metalsmith-in-place-causing-rendering-error