├── .eleventyignore ├── .gitignore ├── posts ├── post-1.md ├── post-2.md └── posts.json ├── index.html ├── README.md ├── package.json ├── _includes └── layout.html └── LICENSE /.eleventyignore: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | _site 3 | package-lock.json -------------------------------------------------------------------------------- /posts/post-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post 1 3 | --- 4 | Post content. -------------------------------------------------------------------------------- /posts/post-2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Post 2 3 | --- 4 | Post content. -------------------------------------------------------------------------------- /posts/posts.json: -------------------------------------------------------------------------------- 1 | { 2 | "layout": "layout.html", 3 | "tags": "post", 4 | "permalink": "/{{ page.fileSlug }}/" 5 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout.html 3 | --- 4 | {% for post in collections.post %} 5 |

{{ post.data.title }}

6 |

{{ post.templateContent }}

7 | {% endfor %} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # demo-eleventy-from-scratch-blog 2 | 3 | Companion code to the “6 Minutes to Build a Blog from Scratch” tutorial: https://www.youtube.com/watch?v=kzf9A9tkkl4 4 | 5 | Run this: 6 | 7 | ``` 8 | npm install 9 | npm start 10 | ``` 11 | 12 | Navigate to `http://localhost:8080/` in your web browser. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-eleventy-from-scratch-blog", 3 | "version": "1.0.0", 4 | "description": "Companion code to the “6 Minutes to Build a Blog from Scratch” tutorial.", 5 | "scripts": { 6 | "start": "npx @11ty/eleventy --serve", 7 | "build": "npx @11ty/eleventy" 8 | }, 9 | "license": "MIT", 10 | "dependencies": { 11 | "@11ty/eleventy": "^2.0.1" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /_includes/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ title | default: "My Blog" }} 7 | 8 | 9 |
10 |

{{ title | default: "My Blog" }}

11 |
12 |
13 | {{ content }} 14 |
15 | 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Zach Leatherman @zachleat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------