Demo of 11ty & Netlify on YouTube
Mini site available at https://demoblog.netlify.com/
git clone urlcd into foldercode . -rnpm init -ynpm i @11ty/eleventy (note: org/repo)
npx eleventy
npx eleventy --serve
/about/ page9:45 Add _includes folder
default-layout.njk11:00 Point content files at layout
_includes path, 11ty looks there by default---
layout: default-layout.njk
---
11:47 Add content to body ``
12:23 Add html layout
<html>, <head>, <body><h1> with site name like "VT CC Blog" (to prove we're on layout)12:49 View Site - Site name should appear
ReadMe to <h2> and <title> elements14:13 Add navigation to layout page
nav
ul
li a(href='/') home
li a(href='/about/') about
14:48 View site - click between pages
15:20 Add styles in dev tools
body {
max-width: 50rem;
margin: 0 auto;
}
nav ul {
list-style: none;
display: flex;
background:aliceblue
}
nav ul li {
padding: 5px
}
16:57 Introduce asset pipeline
17:28 Create assets folder
styles.css and paste in styles17:45 Add 11ty config
.eleventy.jsmodule.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy('assets')
}
18:41 Restart eleventy (config only read on startup)
_site19:13 Add stylesheet to layout <link rel="stylesheet" href="/assets/style.css">
19:45 View Site - Styles are applied