11ty

Eleventy Documentation

⚠️ This documentation is for an older version. Go to the newest Eleventy docs or check out the full release history.

Documentation Pages

Pug

Template Languages:

Eleventy Short Name File Extension NPM Package
pug .pug pug

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.

Set your own Library instance

New in Eleventy 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);
};

Compile/Render Options

New in Eleventy v0.2.15: Set compile/render options using the Configuration API. See all Pug options.

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

Supported Features

Feature Syntax
✅ Includes (Absolute) include /includedvar.pug looks in _includes/includedvar.pug
✅ Includes (Relative) (New in Eleventy v0.2.15) include includedvar.pug looks in _includes/includedvar.pug
✅ Extends (Absolute) extends /layout.pug looks in _includes/layout.pug
✅ Extends (Relative) (New in Eleventy v0.2.15) extends layout.pug looks in _includes/layout.pug