├── .gitignore ├── src ├── _data │ ├── site.js │ └── bar.js ├── liquid.liquid ├── nunjucks.njk └── eleventy.11ty.js ├── www ├── liquid │ └── index.html ├── nunjucks │ └── index.html └── eleventy │ └── index.html ├── package.json └── .eleventy.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /src/_data/site.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | baseUrl: "https://11ty.dev/", 3 | author: "John Smith", 4 | }; 5 | -------------------------------------------------------------------------------- /src/_data/bar.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | "one", 3 | "two", 4 | "three", 5 | "four", 6 | "five", 7 | ]; 8 | -------------------------------------------------------------------------------- /src/liquid.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: LiquidJS 3 | --- 4 | 5 |
{{ bar | foo }}
7 | {{ "first" | fooLiquid: "second" }}
8 |
--------------------------------------------------------------------------------
/src/nunjucks.njk:
--------------------------------------------------------------------------------
1 | ---
2 | title: Nunjucks
3 | ---
4 |
5 | {{ bar | foo | safe }}
7 | {{ "first" | fooNjk("second") | safe }}
8 |
--------------------------------------------------------------------------------
/www/liquid/index.html:
--------------------------------------------------------------------------------
1 | foo=["one","two","three","four","five"]3 |
4 | site.author=John Smith; 5 | title=LiquidJS; 6 | arr="first"; 7 | prop2=second; 8 |10 | -------------------------------------------------------------------------------- /www/nunjucks/index.html: -------------------------------------------------------------------------------- 1 |
foo=["one","two","three","four","five"]3 |
4 | site.author=John Smith; 5 | title=Nunjucks; 6 | arr="first"; 7 | prop2=second; 8 |10 | -------------------------------------------------------------------------------- /www/eleventy/index.html: -------------------------------------------------------------------------------- 1 |
foo=["one","two","three","four","five"]3 |
4 | site.author=John Smith; 5 | title=eleventy.11ty.js; 6 | arr="first"; 7 | prop2=second; 8 |10 | -------------------------------------------------------------------------------- /src/eleventy.11ty.js: -------------------------------------------------------------------------------- 1 | module.exports = class Home { 2 | get data() { 3 | return { 4 | title: "eleventy.11ty.js", 5 | }; 6 | } 7 | async render(data) { 8 | // console.log(Object.keys(data).sort()); 9 | const { site, title } = data; 10 | return ` 11 |
${ this.foo(data.bar) }
13 | ${ this.fooJs("first", "second", site, title)}
14 | `;
15 | }
16 | };
17 |
18 | {/* {{ bar | foo | safe }}
20 | {{ "first" | fooNjk("second") | safe }} */}
21 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "11ty-2841",
3 | "description": "",
4 | "version": "1.0.0",
5 | "author": "Peter deHaan