Skip to content

Instantly share code, notes, and snippets.

@zachleat
Created June 24, 2022 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachleat/2747c0fca9a761f6ad26fe8e2f310a0f to your computer and use it in GitHub Desktop.
Save zachleat/2747c0fca9a761f6ad26fe8e2f310a0f to your computer and use it in GitHub Desktop.
Add your own Handlebars partial directlyto Eleventy
// via https://www.11ty.dev/docs/languages/handlebars/#optional-set-your-own-library-instance
module.exports = function(eleventyConfig) {
let handlebars = require("handlebars");
// see https://handlebarsjs.com/guide/partials.html#basic-partials
handlebars.registerPartial("name", "Handlebars syntax");
eleventyConfig.setLibrary("hbs", handlebars);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment