npm install @11ty/eleventy --save-dev
echo '' >> .gitignore
echo "# Eleventy build folder" >> .gitignore
echo "_site" >> .gitignore
index.mdtouch index.md
index.md# Hello markdown world!
Welcome to our home page!
Checkout our code snippets!
base.html layoutbase.htmlbody tag to go inmkdir _includes
touch _includes/base.html
base.htmlcontent placeholdercontent is an eleventy reserved variable name<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width; initial-width=1.0">
<title>Code Docs</title>
</head>
<body>
{{ content }}
</body>
</html>
touch eleventy.config.js
._site directory
// Dynamic setup and plugins
export default async function(eleventyConfig) {
eleventyConfig.addGlobalData("layout", "base.html");
};
// Static settings
export const config = {
setTemplateFormats: ["md", "html"],
markdownTemplateEngine: false,
htmlTemplateEngine: "liquid",
dir: {
input: ".",
output: "_site"
}
};
npm pkg set scripts.build="eleventy"
npm pkg set scripts.serve="eleventy --serve"
npm run serve
git add .
git commit -m 'Adds eleventy setup'
git push
Next:
Add New Page