├── .gitignore
├── src
├── _includes
│ ├── basics1.md
│ ├── basics2.md
│ ├── advanced1.md
│ └── advanced2.md
├── chapter-1
│ └── chapter-1.md
├── chapter-2
│ ├── chapter-2.md
│ └── section-2-1
│ │ └── section-2-1.md
├── chapter-3
│ ├── chapter-3.md
│ └── section-3-1
│ │ └── section-3-1.md
├── src.11tydata.js
└── index.md
├── .eleventy.js
├── package.json
├── README.md
└── www
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/src/_includes/basics1.md:
--------------------------------------------------------------------------------
1 | #### Chapter 2 - Section 1 - Basics 1
2 |
--------------------------------------------------------------------------------
/src/_includes/basics2.md:
--------------------------------------------------------------------------------
1 | #### Chapter 2 - Section 1 - Basics 2
2 |
--------------------------------------------------------------------------------
/src/_includes/advanced1.md:
--------------------------------------------------------------------------------
1 | #### Chapter 3 - Section 1 - Advanced 1
2 |
--------------------------------------------------------------------------------
/src/_includes/advanced2.md:
--------------------------------------------------------------------------------
1 | #### Chapter 3 - Section 1 - Advanced 2
2 |
--------------------------------------------------------------------------------
/src/chapter-1/chapter-1.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Chapter 1
3 | order: 100
4 | ---
5 |
6 | ## {{ title }}
7 |
--------------------------------------------------------------------------------
/src/chapter-2/chapter-2.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Chapter 2
3 | order: 200
4 | ---
5 |
6 | ## {{ title }}
7 |
--------------------------------------------------------------------------------
/src/chapter-3/chapter-3.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Chapter 3
3 | order: 300
4 | ---
5 |
6 | ## {{ title }}
7 |
--------------------------------------------------------------------------------
/src/src.11tydata.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | permalink: false,
3 | tags: ["chapters"],
4 | order: -1
5 | };
6 |
--------------------------------------------------------------------------------
/src/chapter-2/section-2-1/section-2-1.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Chapter 2 - Section 1
3 | order: 210
4 | ---
5 |
6 | ### {{ title }}
7 |
8 | {% render "basics1.md" %}
9 | {% render "basics2.md" %}
10 |
--------------------------------------------------------------------------------
/src/chapter-3/section-3-1/section-3-1.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Chapter 3 - Section 1
3 | order: 310
4 | ---
5 |
6 | ### {{ title }}
7 |
8 | {% render "advanced1.md" %}
9 | {% render "advanced2.md" %}
10 |
--------------------------------------------------------------------------------
/src/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Content Title
3 | permalink: /
4 | eleventyExcludeFromCollections: true
5 | ---
6 |
7 | # {{ title }}
8 |
9 | {% for p in collections.chapters %}
10 |
11 | {{ p.templateContent }}
12 |
13 | {% endfor %}
14 |
--------------------------------------------------------------------------------
/.eleventy.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @typedef {import('@11ty/eleventy/src/UserConfig')} EleventyConfig
3 | * @typedef {ReturnType} EleventyReturnValue
4 | * @type {(eleventyConfig: EleventyConfig) => EleventyReturnValue}
5 | */
6 | module.exports = function (eleventyConfig) {
7 | eleventyConfig.addCollection("chapters", function (collectionApi) {
8 | const chapters = collectionApi.getFilteredByTag("chapters");
9 | return [...chapters]
10 | .sort((a, b) => a.data.order - b.data.order);
11 | });
12 |
13 | return {
14 | dir: {
15 | input: "src",
16 | output: "www",
17 | }
18 | };
19 | };
20 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "11ty-254",
3 | "description": "One page 11ty",
4 | "version": "1.0.0",
5 | "author": "Peter deHaan ",
6 | "bugs": {
7 | "url": "https://github.com/pdehaan/11ty-254/issues"
8 | },
9 | "devDependencies": {
10 | "@11ty/eleventy": "^1.0.2"
11 | },
12 | "homepage": "https://github.com/pdehaan/11ty-254#readme",
13 | "keywords": [],
14 | "license": "MPL-2.0",
15 | "main": ".eleventy.js",
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/pdehaan/11ty-254.git"
19 | },
20 | "scripts": {
21 | "build": "eleventy --quiet",
22 | "test": "echo \"Error: no test specified\" && exit 1"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ```sh
3 | tree . --gitignore -a
4 |
5 | .
6 | ├── .eleventy.js
7 | ├── .gitignore
8 | ├── README.md
9 | ├── package-lock.json
10 | ├── package.json
11 | ├── src
12 | │ ├── _includes
13 | │ │ ├── advanced1.md
14 | │ │ ├── advanced2.md
15 | │ │ ├── basics1.md
16 | │ │ └── basics2.md
17 | │ ├── chapter-1
18 | │ │ └── chapter-1.md
19 | │ ├── chapter-2
20 | │ │ ├── chapter-2.md
21 | │ │ └── section-2-1
22 | │ │ └── section-2-1.md
23 | │ ├── chapter-3
24 | │ │ ├── chapter-3.md
25 | │ │ └── section-3-1
26 | │ │ └── section-3-1.md
27 | │ ├── index.md
28 | │ └── src.11tydata.js
29 | └── www
30 | └── index.html
31 |
32 | 8 directories, 17 files
33 | ```
34 |
--------------------------------------------------------------------------------
/www/index.html:
--------------------------------------------------------------------------------
1 | Content Title
2 |
5 |
8 |
9 | Chapter 2 - Section 1
10 | Chapter 2 - Section 1 - Basics 1
11 | Chapter 2 - Section 1 - Basics 2
12 |
13 |
16 |
17 | Chapter 3 - Section 1
18 | Chapter 3 - Section 1 - Advanced 1
19 | Chapter 3 - Section 1 - Advanced 2
20 |
21 |
--------------------------------------------------------------------------------