├── .gitignore ├── filters └── get-foo.js ├── shortcodes ├── index.js └── table.js ├── src └── index.liquid ├── www └── index.html ├── .eleventy.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /filters/get-foo.js: -------------------------------------------------------------------------------- 1 | module.exports = function (value) { 2 | return String(value).toUpperCase(); 3 | }; 4 | -------------------------------------------------------------------------------- /shortcodes/index.js: -------------------------------------------------------------------------------- 1 | module.exports = (cfg) => { 2 | const table = require("./table.js")(cfg); 3 | cfg.addShortcode("table", table); 4 | }; 5 | -------------------------------------------------------------------------------- /src/index.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: 11ty-3192 3 | phrase: cause pails trite 4 | --- 5 | 6 |

{{ title | getFoo }}

7 | 8 | {% table phrase %} 9 | -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 |

11TY-3192

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
CAUSE PAILS TRITE
10 | -------------------------------------------------------------------------------- /shortcodes/table.js: -------------------------------------------------------------------------------- 1 | module.exports = function (cfg = {}) { 2 | const foo = cfg.getFilter("getFoo"); 3 | return function (phrase = "") { 4 | return `
${foo(phrase)}
`; 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /.eleventy.js: -------------------------------------------------------------------------------- 1 | const getFoo = require('./filters/get-foo.js'); 2 | 3 | module.exports = (eleventyConfig) => { 4 | eleventyConfig.addFilter("getFoo", getFoo); 5 | 6 | require("./shortcodes/index.js")(eleventyConfig); 7 | 8 | return { 9 | dir: { 10 | input: "src", 11 | output: "www", 12 | }, 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "11ty-3192", 3 | "description": "", 4 | "version": "1.0.0", 5 | "author": "Peter deHaan ", 6 | "bugs": { 7 | "url": "https://github.com/pdehaan/11ty-3192/issues" 8 | }, 9 | "dependencies": { 10 | "@11ty/eleventy": "^2.0.1" 11 | }, 12 | "devDependencies": {}, 13 | "homepage": "https://github.com/pdehaan/11ty-3192#readme", 14 | "keywords": [], 15 | "license": "MPL-2.0", 16 | "main": "index.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/pdehaan/11ty-3192.git" 20 | }, 21 | "scripts": { 22 | "build": "eleventy", 23 | "test": "echo \"Error: no test specified\" && exit 1" 24 | } 25 | } 26 | --------------------------------------------------------------------------------