├── .gitignore ├── src ├── _includes │ └── layouts │ │ └── base.njk └── pages │ └── index.md ├── .eleventy.js ├── package.json └── www └── pages └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /src/_includes/layouts/base.njk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | {% block head %}{% endblock %} 8 | 9 | 10 | 11 |
{% block content %}{% endblock %}
12 | {% block footer %}{% endblock %} 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.eleventy.js: -------------------------------------------------------------------------------- 1 | const markdownIt = require("markdown-it"); 2 | 3 | /** 4 | * @param {import("@11ty/eleventy/src/UserConfig")} eleventyConfig 5 | */ 6 | module.exports = function (eleventyConfig) { 7 | const mdOptions = { 8 | html: true, 9 | breaks: true, 10 | linkify: true 11 | }; 12 | 13 | eleventyConfig.setLibrary("md", markdownIt(mdOptions).disable("code")); 14 | 15 | return { 16 | dir: { 17 | input: "src", 18 | output: "www", 19 | }, 20 | markdownTemplateEngine: "njk", 21 | 22 | }; 23 | }; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "11ty-2521", 3 | "description": "", 4 | "version": "1.0.0", 5 | "author": "Peter deHaan ", 6 | "bugs": { 7 | "url": "https://github.com/pdehaan/11ty-2521/issues" 8 | }, 9 | "devDependencies": { 10 | "@11ty/eleventy": "^1.0.1" 11 | }, 12 | "homepage": "https://github.com/pdehaan/11ty-2521#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-2521.git" 19 | }, 20 | "scripts": { 21 | "build": "eleventy", 22 | "postbuild": "npx prettier www --write", 23 | "test": "echo \"Error: no test specified\" && exit 1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/pages/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Homepage 3 | description: This is my website. There are many like it, but this one is mine. My website is my best friend. It is my life. I must master it as I must master my life. 4 | --- 5 | 6 | {% extends "layouts/base.njk" %} 7 | 8 | {% block head %} 9 | 10 | 15 | {% endblock %} 16 | 17 | {% block footer %} 18 | 19 | {% endblock %} 20 | 21 | {% block content %} 22 | 23 | # This is a header 24 | 25 | Some into content. 26 | 27 | ## Subheader ahoy! 28 | 29 | And some more lovely content to be written here. 30 | 31 | ```js 32 | console.log("Is this a code block?"); 33 | ``` 34 | {% endblock %} 35 | 36 | 37 | -------------------------------------------------------------------------------- /www/pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Homepage 6 | 7 | 11 | 16 | 17 | 18 |
19 |

This is a header

20 |

Some into content.

21 |

Subheader ahoy!

22 |

And some more lovely content to be written here.

23 |
console.log("Is this a code block?");
24 | 
25 |
26 | 30 | 31 | 32 | --------------------------------------------------------------------------------