Releases: patrickxchong/eleventy-plugin-svg-sprite
Releases · patrickxchong/eleventy-plugin-svg-sprite
v2.4.2
v2.0.0
Set SVG id naming convention
Support array config in plugin
Allow plugin user to pass in config either as a single javascript object, or an array of config javascript objects to create multiple SVGSprite shortcodes. Examples below:
Single config object
const svgSprite = require("eleventy-plugin-svg-sprite");
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(svgSprite, {
path: "./src/assets/svg", // relative path to SVG directory
// (MUST be defined when initialising plugin)
});
};
Array of config objects
const svgSprite = require("eleventy-plugin-svg-sprite");
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(svgSprite, [
{
path: "./src/assets/svg_1", // relative path to SVG directory
svgSpriteShortcode: "svgsprite1",
},
{
path: "./src/assets/svg_2", // relative path to SVG directory
svgSpriteShortcode: "svgsprite2",
}
]);
};
Refer to README and demo folder for additional guidance.