0.1.6 • Published 2 years ago

eleventy-plugin-ignore v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

eleventy-plugin-ignore

$ npm i eleventy-plugin-ignore

Ignore files based on their front matter.

Usage

A description of the available options and their defaults are given:

eleventyConfig.addPlugin(
  require("eleventy-plugin-ignore"),
  {
    // template ignored if function returns true
    ignore: (data) =>
      data.ignore ||
      (data.draft && NODE_ENV === "production"),
    // check all templates ending with these extensions
    templateFormats: ["html", "liquid", "md", "njk"]
  }
);

Limitations

This plugin does not delete ignored templates from the output directory. It is recommended that you clear your output direct before each build.

When using eleventy --serve, any change to the front matter of a template will require a second rebuild for the template to be ignored. This is because eleventy currently processes ignores before running the beforeBuild callbacks (see this issue).

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.0

2 years ago