1.16.2 • Published 3 months ago

eleventy-plugin-pack11ty v1.16.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

[ Pack11ty ] eleventy-plugin-pack11ty

npm npm GitHub stars Follow @nhoizey@mamot.fr

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-pack11ty

Then, in your Eleventy configuration file (usually .eleventy.js or eleventy.config.js), load the plugin as follows:

const pack11tyPlugin = require('eleventy-plugin-pack11ty');

module.exports = function (eleventyConfig) {
	eleventyConfig.addPlugin(pack11tyPlugin);
};

Usage

Options

You can set some options for the plugin to activate and configure some transforms.

Change the previous code to this and replace the false values as you wish:

const pack11tyPlugin = require('eleventy-plugin-pack11ty');

module.exports = function (eleventyConfig) {
	eleventyConfig.addPlugin(pack11tyPlugin, {
		responsiver: false,
		minifyHtml: false,
	});
};
Option nameDescriptionValue
responsiverTransform 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.
minifyHtmlMinify the HTML after building pages. Recommended for a production build only.false (default) or true

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!