Skip to content

Commit 101e2d4

Browse files
committed
docs: Add subdirectory demo
1 parent 2739418 commit 101e2d4

File tree

12 files changed

+2972
-0
lines changed

12 files changed

+2972
-0
lines changed

demo/subdir/.eleventy.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const svgSprite = require("eleventy-plugin-svg-sprite");
2+
3+
module.exports = function (eleventyConfig) {
4+
eleventyConfig.addPlugin(svgSprite, {
5+
path: "./assets/svg",
6+
globalClasses: "svgicon",
7+
defaultClasses: "default-class"
8+
});
9+
};
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading
Lines changed: 11 additions & 0 deletions
Loading

demo/subdir/custom-shortcode.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eleventyConfig.addShortcode("icon", function (name) {
2+
return `<svg><use xlink:href="#svg-${name}"></use></svg>`;
3+
});

demo/subdir/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.svgsprite()}
4+
${this.svg("sub_dir_1--placeholder-feature")}
5+
${this.svg("sub_dir_2--sub_sub_dir_2--placeholder_slider")}
6+
${this.svg("placeholder-thumb","custom-class-1 custom-class-2")}
7+
</div>`;
8+
};

demo/subdir/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+
{{{svgsprite}}}
9+
10+
{{{svg "sub_dir_1--placeholder-feature"}}}
11+
{{{svg "sub_dir_2--sub_sub_dir_2--placeholder_slider"}}}
12+
{{{svg "placeholder-thumb" "custom-class-1 custom-class-2"}}}
13+
</body>
14+
</html>

demo/subdir/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+
{% svgsprite %}
10+
11+
{% svg "sub_dir_1--placeholder-feature" %}
12+
{% svg "sub_dir_2--sub_sub_dir_2--placeholder_slider" %}
13+
{% svg "placeholder-thumb", "custom-class-1 custom-class-2"%}
14+
</body>
15+
</html>

demo/subdir/demo-nunjucks.njk

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+
{% svgsprite %}
10+
11+
{% svg "sub_dir_1--placeholder-feature" %}
12+
{% svg "sub_dir_2--sub_sub_dir_2--placeholder_slider" %}
13+
{% svg "placeholder-thumb", "custom-class-1 custom-class-2" %}
14+
</body>
15+
</html>

demo/subdir/index.njk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<h1>Demo</h1>
2+
<h2>Nunjucks</h2>
3+
<iframe style="display: block; width: 100%; min-height: 200px"
4+
src="/demo-nunjucks" frameborder="0"></iframe>
5+
<h2>Liquid</h2>
6+
<iframe style="display: block; width: 100%; min-height: 200px"
7+
src="/demo-liquid" frameborder="0"></iframe>
8+
<h2>Handlerbars</h2>
9+
<iframe style="display: block; width: 100%; min-height: 200px"
10+
src="/demo-handlebars" frameborder="0"></iframe>
11+
<h2>11ty.js</h2>
12+
<iframe style="display: block; width: 100%; min-height: 200px" src="/demo-11ty"
13+
frameborder="0"></iframe>

0 commit comments

Comments
 (0)