├── .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.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 |