Skip to content

Commit c86c7dd

Browse files
committed
feat: add new examples that use array config
1 parent d744a87 commit c86c7dd

23 files changed

+163
-5
lines changed

demo/array_config/.eleventy.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const svgSprite = require("eleventy-plugin-svg-sprite");
2+
3+
module.exports = function (eleventyConfig) {
4+
eleventyConfig.addPlugin(svgSprite, [{
5+
path: "./assets/svg_general",
6+
svgSpriteShortcode: "svgspriteGeneral",
7+
globalClasses: "svgicon",
8+
defaultClasses: "default-class"
9+
},
10+
{
11+
path: "./assets/svg_home",
12+
svgSpriteShortcode: "svgspriteHome",
13+
svgShortcode: "svgHome", // optional to have custom svgShortcode per instance. The default "svg" shortcode would work for all instances.
14+
globalClasses: "svgicon",
15+
defaultClasses: "default-class"
16+
}, {
17+
path: "./assets/svg_profile",
18+
svgSpriteShortcode: "svgspriteProfile",
19+
globalClasses: "svgicon",
20+
defaultClasses: "default-class"
21+
}]);
22+
};
File renamed without changes.

demo/array_config/demo-11ty.11ty.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = function () {
2+
return `<div>
3+
${this.svgspriteHome()}
4+
${this.svg("placeholder-feature")}
5+
${this.svg("placeholder-slider")} <!-- svg does not load because svgspriteGeneral directory does not have 'placeholder-slider' -->
6+
${this.svg("placeholder-thumb","custom-class-1 custom-class-2")} <!-- svg does not load because svgspriteGeneral directory does not have 'placeholder-thumb' -->
7+
</div>`;
8+
};

demo/array_config/demo-handlebars.hbs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="utf-8" />
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
5+
<title></title>
6+
</head>
7+
<body>
8+
{{{svgspriteProfile}}}
9+
10+
{{{svg "placeholder-feature"}}} <!-- svg does not load because svgspriteGeneral directory does not have 'placeholder-feature' -->
11+
{{{svg "placeholder-slider"}}}
12+
{{{svg "placeholder-thumb" "custom-class-1 custom-class-2"}}} <!-- svg does not load because svgspriteGeneral directory does not have 'placeholder-thumn' -->
13+
</body>
14+
</html>

demo/array_config/demo-liquid.liquid

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title></title>
7+
</head>
8+
<body>
9+
{% svgspriteGeneral %}
10+
11+
{% svg "placeholder-feature" %} <!-- svg does not load because svgspriteGeneral directory does not have 'placeholder-feature' -->
12+
{% svg "placeholder-slider" %} <!-- svg does not load because svgspriteGeneral directory does not have 'placeholder-slider' -->
13+
{% svg "placeholder-thumb", "custom-class-1 custom-class-2"%}
14+
</body>
15+
</html>

demo/array_config/demo-nunjucks.njk

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title></title>
7+
</head>
8+
<body>
9+
{% svgspriteGeneral %}
10+
{% svgspriteHome %}
11+
{% svgspriteProfile %}
12+
13+
{% svg "placeholder-feature" %}
14+
{% svgHome "placeholder-slider" %} <!-- this works -->
15+
{% svg "placeholder-slider" %} <!-- this works too -->
16+
{% svg "placeholder-thumb", "custom-class-1 custom-class-2" %}
17+
</body>
18+
</html>
File renamed without changes.

0 commit comments

Comments
 (0)