To see the value of a variable, use the 11ty log
filter which calls console.log
. This writes to the terminal window where the Eleventy server is running, not to the DevTools console.
For example:
{% set temp = myVariable | log %}
TODO: Do you have to use an assignment in order to TODO: avoid rendering something to the browser?
To render the content of an array or object within a page, use the Nunjucks dump
filter which calls JSON.stringify
.
For example:
{{ myVariable | dump }}