Skip to navigation Skip to main content
11ty Logo Sustainability Fundraising
Eleventy
Eleventy Documentation
Stable
2.0.1
Canary
3.0.0-alpha.10
Toggle Menu
Eleventy 5.81s
Gatsby 43.36s

Mustache

Contents

Eleventy Short Name File Extension npm Package
mustache .mustache mustache.js

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

Mustache Options Jump to heading

Optional: Set your own Library instance Jump to heading

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

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

Supported Features Jump to heading

Feature Syntax
✅ Partials {{> user}} looks for _includes/user.mustache. Does not process front matter in the include file.
🚫 Partials (Relative Path) Not yet supported: {{> ./user}} looks for user.mustache in the template’s current directory.

Other pages in Template Languages: