npm init -y && npm install @11ty/eleventy
Update scripts
in package.json
"scripts": {
"develop": "eleventy --serve",
"build": "eleventy"
},
Create src/
Create src/index.md
Create _includes/base.njk
Emmet: html:5
<title>{{ title }}</title>
<h1>{{ title }}</h1>
After h1
add:
{{ content | safe }}
Add to the frontmatter:
layout: base.njk
Create at project root: .eleventy.js
Add as contents:
module.exports = function (eleventyConfig) {
return {
dir: {
input: "src",
output: "public",
},
};
};
npm run develop