11tyThe possum is Eleventy’s mascot

Eleventy Documentation

This is an older version of Eleventy. Full release history. Go to the newest Eleventy docs. You could try /docs/languages/pug/ although it may not exist.

Documentation Pages

Pug

Template Languages:

Eleventy Short NameFile ExtensionNPM Package
pug.pugpug

Pug templates used to be called Jade templates and the project was renamed.

You can override a .pug file’s template engine. Read more at Changing a Template’s Rendering Engine.

Pug Options #

Optional: Compile/Render Options New in v0.2.15 #

Set compile/render options using the Configuration API. See all Pug options.

module.exports = function(eleventyConfig) {
eleventyConfig.setPugOptions({ debug: true });
};

Optional: Set your own Library instance New in v0.3.0 #

As an escape mechanism for advanced usage, pass in your own instance of the Pug library using the Configuration API.

module.exports = function(eleventyConfig) {
let pug = require("pug");
eleventyConfig.setLibrary("pug", pug);
};

Supported Features #

FeatureSyntax
✅ Includes (Absolute)include /includedvar.pug looks in _includes/includedvar.pug (does not process front matter)
✅ Includes (Relative) (New in Eleventy v0.2.15)include includedvar.pug looks in _includes/includedvar.pug (does not process front matter)
✅ Extends (Absolute)extends /layout.pug looks in _includes/layout.pug (does not process front matter)
✅ Extends (Relative) (New in Eleventy v0.2.15)extends layout.pug looks in _includes/layout.pug (does not process front matter)