eleventy-plugin-pack11ty
v2.6.1
Published
An heavily opinionated set of filters, shortcodes, transforms for Eleventy, linked to the Pack11ty template project
Maintainers
Readme
[ Pack11ty ] eleventy-plugin-pack11ty
Pack11ty is an heavily opinionated Eleventy starter (aka "template project").
eleventy-plugin-pack11ty is an Eleventy plugin containing a set of filters, shortcodes, transforms and plugins for Eleventy, used in the Pack11ty starter, but also usable in any other Eleventy project.
Feel free to use it, enhance it, and share your ideas/comments with issues, or (even better) pull requests.
Installation
You can either use the Pack11ty starter, or install the plugin into your existing Eleventy project:
npm install --save-dev eleventy-plugin-pack11tyThen, in your Eleventy configuration file (usually .eleventy.js or eleventy.config.js), load the plugin as follows:
import eleventyPluginPack11ty from 'eleventy-plugin-pack11ty';
export default async function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginPack11ty);
};Usage
Options
You can set some options for the plugin to activate and configure some features, including transforms.
Change the previous code to this and replace the false values as you wish:
import eleventyPluginPack11ty from 'eleventy-plugin-pack11ty';
export default async function (eleventyConfig) {
eleventyConfig.addPlugin(eleventyPluginPack11ty, {
responsiver: false,
minifyHtml: false,
});
};| Option name | Description | Value |
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| responsiver | Transform simple <img src="…"> images into responsive images with srcset/sizes attributes with eleventy-plugin-images-responsiver. | false (default) or an object with multiple keys. See details in the Tranforms section below. |
| minifyHtml | Minify the HTML after building pages. Recommended for a production build only. | false (default) or true |
| markdown.firstLevel | Define which HTML heading level to use for the first heading level in Markdown files. | 2 (default) or another value |
| markdown.containers | Define containers to add to Markdown | ["info"] (default) or an array of strings. |
| passthroughCopy | Copy static files to the output folder. | true (default) or false |
| passthroughCopyGlob | Define which static files to copy frml the collections and pages subfolders. All content of the static folder will always be copied. | "**/*.{jpg,jpeg,png,gif,webp,avif,svg}" (default) |
Generate drafts only locally
Time zone and locale
Filters
Arrays
Strings
HTML
Nunjucks shortcodes
Paired shortcode
Transforms
Responsive images
Minify HTML
Included plugins
Would you like to know more?
Read the full documentation on pack11ty.dev!
