Skip to content

jgarber623/eleventy-plugin-template

Repository files navigation

eleventy-plugin-template

Note

Thanks for using this template! You'll first want to find-and-replace instances of eleventy-plugin-template, templatePlugin, and An Eleventy plugin for…. If you're not me, you'll also want to update author information in package.json and LICENSE, replace instances of jgarber and jgarber623, and update a bunch of URLs.

Once you've done all that, you can remove this note and starting building your Web Component.

An Eleventy plugin for…

npm Downloads Build

Usage

First, add the plugin as a development dependency to your project's package.json file:

npm install --save-dev @jgarber/eleventy-plugin-template

Next, add the plugin to your project's Eleventy configuration file (e.g. eleventy.config.js):

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(require("@jgarber/eleventy-plugin-template"));
};

Options

ESM Support

Eleventy v3.0.0 added bundler-free ESM support. This plugin works with either ESM or CommonJS projects!

import templatePlugin from "@jgarber/eleventy-plugin-template";

export default async function(eleventyConfig) {
  eleventyConfig.addPlugin(templatePlugin);
}

Acknowledgments

First and foremost, eleventy-plugin-template wouldn't be possible without Zach Leatherman's incredible work creating Eleventy and his stewardship of its community.

eleventy-plugin-template is written and maintained by Jason Garber.