Narcissistic Pickle Meister

    eleventy-plugin-ignore
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.6 • Public • Published

    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).

    Keywords

    none

    Install

    npm i eleventy-plugin-ignore

    DownloadsWeekly Downloads

    7

    Version

    0.1.6

    License

    MIT

    Unpacked Size

    9.59 kB

    Total Files

    11

    Last publish

    Collaborators

    • thedoctrier