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 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 #

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 #

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
✅ 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