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

Handlebars

Template Languages:

Eleventy Short Name File Extension NPM Package
hbs .hbs handlebars.js

You can override a .hbs 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 Handlebars library using the Configuration API.

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

Supported Features #

Feature Syntax
✅ Partials {{> user}} looks for _includes/user.hbs
✅ Helpers {{ filterName myObject }} Handlebars calls them Helpers, but Eleventy calls them filters. Read more about Filters.
Eleventy Universal Filters {{ filterName myObject }} Read more about Filters.