Eleventy Project for JS Marathon
Brought to you by This Dot Labs
Check out our live eleventy website
# setup
npm init -y
git init
npx gitignore node
npm install @11ty/eleventy
# run
eleventy --serve
about.njk
contact.md
index.md
-
Create
_includes/defaultLayout.njk
-
Inject
{{content | safe}}
-
Add frontmatter to point to layout
--- layout: defaultLayout.njk ---
- Create
.eleventy.js
- Add
addPassthroughCopy
- Add some styles
- Add
title
property to frontmatter - Consume
{{title}}
elsewhere (in layout)
- Commit changes
- Push to Github
- New Site From Git
- Condition blocks with if...then
- Create
_data/cats.json
global data file - Output with
{{cats | dump}}