Created
June 24, 2022 15:08
-
-
Save zachleat/2747c0fca9a761f6ad26fe8e2f310a0f to your computer and use it in GitHub Desktop.
Add your own Handlebars partial directlyto Eleventy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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