├── .gitignore ├── src ├── _data │ └── myData1.js └── pages │ ├── pages.11tydata.js │ └── index.liquid ├── www └── pages │ └── index.html ├── eleventy.config.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /src/_data/myData1.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | "global1", 3 | "global2" 4 | ]; 5 | -------------------------------------------------------------------------------- /src/pages/pages.11tydata.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | myData2: ["local1", "local2"], 3 | }; 4 | -------------------------------------------------------------------------------- /www/pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | global:
["global1","global2"]
3 | 4 | local:
["local1","local2"]
5 | -------------------------------------------------------------------------------- /src/pages/index.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | title: 11ty-2996 3 | --- 4 | 5 | global:
{{ myData1 | json }}
6 | 7 | local:
{{ myData2 | json }}
8 | -------------------------------------------------------------------------------- /eleventy.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {import("@11ty/eleventy/src/UserConfig")} eleventyConfig 3 | * @returns {ReturnType} 4 | */ 5 | module.exports = function (eleventyConfig) { 6 | return { 7 | dir: { 8 | input: "src", 9 | output: "www", 10 | } 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "11ty-2996", 3 | "description": "", 4 | "version": "1.0.0", 5 | "author": "Peter deHaan ", 6 | "bugs": { 7 | "url": "https://github.com/pdehaan/11ty-2996/issues" 8 | }, 9 | "dependencies": { 10 | "@11ty/eleventy": "^2.0.1" 11 | }, 12 | "devDependencies": {}, 13 | "homepage": "https://github.com/pdehaan/11ty-2996#readme", 14 | "keywords": [], 15 | "license": "MPL-2.0", 16 | "main": "eleventy.config.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/pdehaan/11ty-2996.git" 20 | }, 21 | "scripts": { 22 | "build": "eleventy", 23 | "test": "echo \"Error: no test specified\" && exit 1" 24 | } 25 | } 26 | --------------------------------------------------------------------------------