Stand with Ukraine 🇺🇦
The possum is Eleventy’s mascot

Eleventy Documentation


log Universal Filter Jump to heading

New in v0.11.0 An easy way to console.log anything from inside of a template file.

View this example in: Liquid Nunjucks 11ty.js
Syntax Liquid
{{ "My Title" | log }}
Syntax Nunjucks
{{ "My Title" | log }}
Syntax JavaScript
module.exports = function(data) {
// Caveat: you have access to `console.log` here, so probably use that.
return this.log("My Title");

is functionally the same as running console.log("My Title") inside of your template.

Other pages in Filters: