SlideShare a Scribd company logo
1 of 79
Download to read offline
AN INTRO TO
THE JAMSTACK & ELEVENTY
Luciano Mammino ( )
@loige
loige.link/11ty-jam
May 18, 19, 20 - 2021
1
@loige
loige.link/11ty-jam 2
STATIC SITE GENERATORS... WAIT, WHAT?!
content &
templates
static HTML
pages & assets
This is the core of a static site generator!
@loige
3
WHAT ARE WE TALKING ABOUT? I NEED EXAMPLES!
A programming blog
A recipes website
A movie reviews website
A photo book
An online portfolio
A podcast website
...
And even single-page applications!
@loige
4
LET ME INTRODUCE MYSELF...
@loige
5
LET ME INTRODUCE MYSELF...
I'm Luciano ( 🍕🍝) 👋
@loige
5
LET ME INTRODUCE MYSELF...
I'm Luciano ( 🍕🍝) 👋
 Senior Architect
@loige
5
LET ME INTRODUCE MYSELF...
I'm Luciano ( 🍕🍝) 👋
 Senior Architect
nodejsdp.link
Co-Author of Node.js Design Patterns  👉
@loige
5
LET ME INTRODUCE MYSELF...
I'm Luciano ( 🍕🍝) 👋
 Senior Architect
nodejsdp.link
Co-Author of Node.js Design Patterns  👉
Connect with me:
 
  (blog)
  (twitter)
  (github)
loige.co
@loige
lmammino
@loige
20% eBook discount on Packt
20NODEMAY
5
WE ARE BUSINESS FOCUSED TECHNOLOGISTS THAT DELIVER.
 |  |
Accelerated Serverless AI as a Service Platform Modernisation
Do you want to ?
work with us
loige 6
SOME STATIC SITES I BUILT
loige.co
open source!
@loige
7
fastify.io
METALSMITH
open source!
@loige
8
nodejsdp.link
open source!
@loige
9
@loige
A Java API client!
10
WHY DO WE CARE?
It's easy
It's generally cheap
It can scale easily
It can be more secure
We can build fast websites
We can still use dynamic data (API, CMS, etc.)
We can still add dynamic features
@loige
11
WHICH TOOL SHOULD I USE?
jamstack.org/generators/
+350 tools listed!
@loige
12
WHY DO I LIKE ELEVENTY?
It's written in Node.js
It's so simple that you don't need a "starter"
(but there are if you want)
Fast & lightweight
Not opinionated
Simple to build incrementally on top of it
Makes me feel productive...
many
@loige
13
OK. NOW, LET'S PLAY WITH ELEVENTY!
Install + Hello world
Custom config
Templates, frontmatter & Layouts
Live reload
Copying static files
Custom global data
Collection API
Using dynamic data
Pagination API
@loige
14
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
@loige
PROJECT SCAFFOLD
15
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
1
2
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
@loige
PROJECT SCAFFOLD
15
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
1
2
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
npm i --save-dev @11ty/eleventy
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
@loige
PROJECT SCAFFOLD
15
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
1
2
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
npm i --save-dev @11ty/eleventy
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
echo "# My sample Eleventy website" > index.md
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
npm i --save-dev @11ty/eleventy
5
6
7
8
node_modules/.bin/eleventy --watch --serve
9
@loige
PROJECT SCAFFOLD
15
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
1
2
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
npm i --save-dev @11ty/eleventy
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
echo "# My sample Eleventy website" > index.md
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
npm i --save-dev @11ty/eleventy
5
6
7
8
node_modules/.bin/eleventy --watch --serve
9 node_modules/.bin/eleventy --watch --serve
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
9
@loige
PROJECT SCAFFOLD
15
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
1
2
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
npm i --save-dev @11ty/eleventy
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
5
6
echo "# My sample Eleventy website" > index.md
7
8
node_modules/.bin/eleventy --watch --serve
9
echo "# My sample Eleventy website" > index.md
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
npm i --save-dev @11ty/eleventy
5
6
7
8
node_modules/.bin/eleventy --watch --serve
9 node_modules/.bin/eleventy --watch --serve
mkdir 11ty-sample-project
1
cd 11ty-sample-project
2
npm init -y
3
4
npm i --save-dev @11ty/eleventy
5
6
echo "# My sample Eleventy website" > index.md
7
8
9
mkdir 11ty-sample-project
cd 11ty-sample-project
npm init -y
npm i --save-dev @11ty/eleventy
echo "# My sample Eleventy website" > index.md
node_modules/.bin/eleventy --watch --serve
1
2
3
4
5
6
7
8
9
@loige
PROJECT SCAFFOLD
15
@loige
16
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
@loige
CUSTOM CONFIG
17
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
@loige
CUSTOM CONFIG
17
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
module.exports = function (config) {
// .eleventy.js
1
2
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
@loige
CUSTOM CONFIG
17
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
module.exports = function (config) {
// .eleventy.js
1
2
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
// .eleventy.js
1
2
module.exports = function (config) {
3
4
5
6
7
8
9
}
10
@loige
CUSTOM CONFIG
17
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
module.exports = function (config) {
// .eleventy.js
1
2
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
// .eleventy.js
1
2
module.exports = function (config) {
3
4
5
6
7
8
9
}
10
input: './src', // default: `.`
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
6
output: './build' // default: _site
7
}
8
}
9
}
10
@loige
CUSTOM CONFIG
17
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
module.exports = function (config) {
// .eleventy.js
1
2
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
// .eleventy.js
1
2
module.exports = function (config) {
3
4
5
6
7
8
9
}
10
input: './src', // default: `.`
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
6
output: './build' // default: _site
7
}
8
}
9
}
10
output: './build' // default: _site
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
7
}
8
}
9
}
10
@loige
CUSTOM CONFIG
17
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
module.exports = function (config) {
// .eleventy.js
1
2
3
return {
4
dir: {
5
input: './src', // default: `.`
6
output: './build' // default: _site
7
}
8
}
9
}
10
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
// .eleventy.js
1
2
module.exports = function (config) {
3
4
5
6
7
8
9
}
10
input: './src', // default: `.`
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
6
output: './build' // default: _site
7
}
8
}
9
}
10
output: './build' // default: _site
// .eleventy.js
1
2
module.exports = function (config) {
3
return {
4
dir: {
5
input: './src', // default: `.`
6
7
}
8
}
9
}
10
// .eleventy.js
module.exports = function (config) {
return {
dir: {
input: './src', // default: `.`
output: './build' // default: _site
}
}
}
1
2
3
4
5
6
7
8
9
10
@loige
CUSTOM CONFIG
17
@loige
TEMPLATES
markdown (.md), Nunjucks (.njk) and
 are called templates
These files can be used as a skeleton to generate
pages
Eleventy will automatically search for them in our
source folder and, by default, it will generate a
page for each and every one of them
many other
file types
18
@loige
FRONTMATTER
frontmatter is an optional section at the top of a
template that can be used to define additional
contextual metadata.
---
name: someone
age: 17
---
Rest of the file
19
@loige
FRONTMATTER
Data in the frontmatter can be referenced in the
templates
---
name: someone
age: 17
---
{{ name }} is {{ age }} years old!
20
@loige
LAYOUTS
Layouts are used to wrap the generated pages in a
common HTML structure
Especially useful for Markdown files
Layouts can also have a frontmatter
21
---
title: My default title
---
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{ title }}</title>
</head>
<body>
<main>
{{ content | safe }}
</main>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@loige
src/_includes/base.njk
22
---
title: My default title
---
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{ title }}</title>
</head>
<body>
<main>
{{ content | safe }}
</main>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
title: My default title
---
1
2
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
@loige
src/_includes/base.njk
22
---
title: My default title
---
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{ title }}</title>
</head>
<body>
<main>
{{ content | safe }}
</main>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
title: My default title
---
1
2
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
<title>{{ title }}</title>
---
1
title: My default title
2
---
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
@loige
src/_includes/base.njk
22
---
title: My default title
---
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{ title }}</title>
</head>
<body>
<main>
{{ content | safe }}
</main>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
title: My default title
---
1
2
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
<title>{{ title }}</title>
---
1
title: My default title
2
---
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
{{ content | safe }}
---
1
title: My default title
2
---
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
</head>
9
<body>
10
<main>
11
12
</main>
13
</body>
14
</html>
15
@loige
src/_includes/base.njk
22
---
title: My default title
---
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{ title }}</title>
</head>
<body>
<main>
{{ content | safe }}
</main>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
title: My default title
---
1
2
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
<title>{{ title }}</title>
---
1
title: My default title
2
---
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
8
</head>
9
<body>
10
<main>
11
{{ content | safe }}
12
</main>
13
</body>
14
</html>
15
{{ content | safe }}
---
1
title: My default title
2
---
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
</head>
9
<body>
10
<main>
11
12
</main>
13
</body>
14
</html>
15
---
title: My default title
---
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>{{ title }}</title>
</head>
<body>
<main>
{{ content | safe }}
</main>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@loige
src/_includes/base.njk
22
layout: base
---
1
2
---
3
4
# Hello from Eleventy
5
6
This is a simple Eleventy demo
7
@loige
To use a layout you can use the special frontmatter property "layout" in a
template:
23
@loige
Eleventy uses to give you live-reload 🚀
BrowserSync
24
@loige
COPYING STATIC ASSETS
src/_includes/style.css
html, body {
background-color: #eee;
margin: 0;
}
main {
box-sizing: border-box;
max-width: 1024px;
min-height: 100vh;
padding: 2em;
margin: 0 auto;
background: white;
}
25
@loige
COPYING STATIC ASSETS
// .eleventy.js
module.exports = function (config) {
config.addPassthroughCopy({
'./src/_includes/style.css': 'style.css'
})
// ...
}
1
2
3
4
5
6
7
8
9
26
@loige
COPYING STATIC ASSETS
// .eleventy.js
module.exports = function (config) {
config.addPassthroughCopy({
'./src/_includes/style.css': 'style.css'
})
// ...
}
1
2
3
4
5
6
7
8
9
config.addPassthroughCopy({
// .eleventy.js
1
2
module.exports = function (config) {
3
4
'./src/_includes/style.css': 'style.css'
5
})
6
7
// ...
8
}
9
26
@loige
COPYING STATIC ASSETS
// .eleventy.js
module.exports = function (config) {
config.addPassthroughCopy({
'./src/_includes/style.css': 'style.css'
})
// ...
}
1
2
3
4
5
6
7
8
9
config.addPassthroughCopy({
// .eleventy.js
1
2
module.exports = function (config) {
3
4
'./src/_includes/style.css': 'style.css'
5
})
6
7
// ...
8
}
9
'./src/_includes/style.css': 'style.css'
// .eleventy.js
1
2
module.exports = function (config) {
3
config.addPassthroughCopy({
4
5
})
6
7
// ...
8
}
9
26
@loige
COPYING STATIC ASSETS
// .eleventy.js
module.exports = function (config) {
config.addPassthroughCopy({
'./src/_includes/style.css': 'style.css'
})
// ...
}
1
2
3
4
5
6
7
8
9
config.addPassthroughCopy({
// .eleventy.js
1
2
module.exports = function (config) {
3
4
'./src/_includes/style.css': 'style.css'
5
})
6
7
// ...
8
}
9
'./src/_includes/style.css': 'style.css'
// .eleventy.js
1
2
module.exports = function (config) {
3
config.addPassthroughCopy({
4
5
})
6
7
// ...
8
}
9
// .eleventy.js
module.exports = function (config) {
config.addPassthroughCopy({
'./src/_includes/style.css': 'style.css'
})
// ...
}
1
2
3
4
5
6
7
8
9
26
<link rel="stylesheet" href="/style.css"/>
---
1
title: My default title
2
---
3
<!DOCTYPE html>
4
<head>
5
<meta charset="utf-8"/>
6
<meta name="viewport" content="width=device-width, initial-scale=1"/>
7
<title>{{ title }}</title>
8
9
</head>
10
<body>
11
<main>
12
{{ content | safe }}
13
</main>
14
</body>
15
</html>
16
@loige
src/_includes/base.njk
27
@loige
GLOBAL DATA FILES
// src/_data/site.js
module.exports = {
author: 'Luciano Mammino',
copyrightYear: (new Date()).getFullYear()
}
Define globally available data
JavaScript code that gets executed before templates are
rendered
Can be static or dynamic (e.g. fetch data from an API or a DB)
28
@loige
GLOBAL DATA FILES
A website by {{ site.author }}
- &copy; {{ site.copyrightYear }}
<main>
1
{{ content | safe }}
2
<hr/>
3
<small>
4
5
6
</small>
7
</main>
8
The filename defines how you access the data in templates
29
@loige
COLLECTION API
tags: ["posts", "javascript"]
---
1
2
---
3
4
## An introduction to the spread syntax
5
6
**Spread syntax** (`...`) allows an iterable such as an array
7
expression or string to be expanded in places where zero or
8
more arguments (for function calls) or elements
9
(for array literals) are expected, or an object expression
10
to be expanded in places where zero or more
11
key-value pairs (for object literals) are expected.
12
You can tag a template to be part of one or more collections
Use the special frontmatter entry "tags"
30
@loige
COLLECTION API
---
title: "All posts"
layout: base
---
<h1>All posts</h1>
<ul>
{% for post in collections.posts %}
<li>
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Eleventy allows you to access all the metadata of templates for a
given tag using the special collections.tagName global data
31
@loige
COLLECTION API
---
title: "All posts"
layout: base
---
<h1>All posts</h1>
<ul>
{% for post in collections.posts %}
<li>
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% for post in collections.posts %}
---
1
title: "All posts"
2
layout: base
3
---
4
5
<h1>All posts</h1>
6
7
<ul>
8
9
<li>
10
<a href="{{ post.url }}">
11
{{ post.data.title }}
12
</a>
13
</li>
14
{% endfor %}
15
</ul>
16
Eleventy allows you to access all the metadata of templates for a
given tag using the special collections.tagName global data
31
@loige
COLLECTION API
---
title: "All posts"
layout: base
---
<h1>All posts</h1>
<ul>
{% for post in collections.posts %}
<li>
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% for post in collections.posts %}
---
1
title: "All posts"
2
layout: base
3
---
4
5
<h1>All posts</h1>
6
7
<ul>
8
9
<li>
10
<a href="{{ post.url }}">
11
{{ post.data.title }}
12
</a>
13
</li>
14
{% endfor %}
15
</ul>
16
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
---
1
title: "All posts"
2
layout: base
3
---
4
5
<h1>All posts</h1>
6
7
<ul>
8
{% for post in collections.posts %}
9
<li>
10
11
12
13
</li>
14
{% endfor %}
15
</ul>
16
Eleventy allows you to access all the metadata of templates for a
given tag using the special collections.tagName global data
31
@loige
COLLECTION API
---
title: "All posts"
layout: base
---
<h1>All posts</h1>
<ul>
{% for post in collections.posts %}
<li>
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% for post in collections.posts %}
---
1
title: "All posts"
2
layout: base
3
---
4
5
<h1>All posts</h1>
6
7
<ul>
8
9
<li>
10
<a href="{{ post.url }}">
11
{{ post.data.title }}
12
</a>
13
</li>
14
{% endfor %}
15
</ul>
16
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
---
1
title: "All posts"
2
layout: base
3
---
4
5
<h1>All posts</h1>
6
7
<ul>
8
{% for post in collections.posts %}
9
<li>
10
11
12
13
</li>
14
{% endfor %}
15
</ul>
16
---
title: "All posts"
layout: base
---
<h1>All posts</h1>
<ul>
{% for post in collections.posts %}
<li>
<a href="{{ post.url }}">
{{ post.data.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Eleventy allows you to access all the metadata of templates for a
given tag using the special collections.tagName global data
31
@loige
32
@loige
USING DYNAMIC DATA
npm i --save-dev @11ty/eleventy-cache-assets
What if we want to build a website using data from an API?
For instance this one: https://ghibliapi.herokuapp.com/films/
We don't want to fetch the data after every single change!
33
@loige
USING DYNAMIC DATA
// src/_data/movies.js
const Cache = require('@11ty/eleventy-cache-assets')
module.exports = async function () {
return Cache(
'https://ghibliapi.herokuapp.com/films/',
{ type: 'json' }
)
}
1
2
3
4
5
6
7
8
9
10
34
@loige
USING DYNAMIC DATA
// src/_data/movies.js
const Cache = require('@11ty/eleventy-cache-assets')
module.exports = async function () {
return Cache(
'https://ghibliapi.herokuapp.com/films/',
{ type: 'json' }
)
}
1
2
3
4
5
6
7
8
9
10
return Cache(
'https://ghibliapi.herokuapp.com/films/',
{ type: 'json' }
)
// src/_data/movies.js
1
2
const Cache = require('@11ty/eleventy-cache-assets')
3
4
module.exports = async function () {
5
6
7
8
9
}
10
34
@loige
USING DYNAMIC DATA
// src/_data/movies.js
const Cache = require('@11ty/eleventy-cache-assets')
module.exports = async function () {
return Cache(
'https://ghibliapi.herokuapp.com/films/',
{ type: 'json' }
)
}
1
2
3
4
5
6
7
8
9
10
return Cache(
'https://ghibliapi.herokuapp.com/films/',
{ type: 'json' }
)
// src/_data/movies.js
1
2
const Cache = require('@11ty/eleventy-cache-assets')
3
4
module.exports = async function () {
5
6
7
8
9
}
10
// src/_data/movies.js
const Cache = require('@11ty/eleventy-cache-assets')
module.exports = async function () {
return Cache(
'https://ghibliapi.herokuapp.com/films/',
{ type: 'json' }
)
}
1
2
3
4
5
6
7
8
9
10
34
@loige
USING DYNAMIC DATA
---
layout: base
title: Studio Ghibli movies
---
<h1>Studio Ghibli movies</h1>
<ul>
{% for movie in movies %}
<li>
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 35
@loige
USING DYNAMIC DATA
---
layout: base
title: Studio Ghibli movies
---
<h1>Studio Ghibli movies</h1>
<ul>
{% for movie in movies %}
<li>
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% for movie in movies %}
{% endfor %}
---
1
layout: base
2
title: Studio Ghibli movies
3
---
4
5
<h1>Studio Ghibli movies</h1>
6
7
<ul>
8
9
<li>
10
<a href="/movie/{{ movie.title | slug }">
11
{{ movie.title }}
12
</a>
13
</li>
14
15
</ul>
16 35
@loige
USING DYNAMIC DATA
---
layout: base
title: Studio Ghibli movies
---
<h1>Studio Ghibli movies</h1>
<ul>
{% for movie in movies %}
<li>
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% for movie in movies %}
{% endfor %}
---
1
layout: base
2
title: Studio Ghibli movies
3
---
4
5
<h1>Studio Ghibli movies</h1>
6
7
<ul>
8
9
<li>
10
<a href="/movie/{{ movie.title | slug }">
11
{{ movie.title }}
12
</a>
13
</li>
14
15
</ul>
16
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
---
1
layout: base
2
title: Studio Ghibli movies
3
---
4
5
<h1>Studio Ghibli movies</h1>
6
7
<ul>
8
{% for movie in movies %}
9
<li>
10
11
12
13
</li>
14
{% endfor %}
15
</ul>
16 35
@loige
USING DYNAMIC DATA
---
layout: base
title: Studio Ghibli movies
---
<h1>Studio Ghibli movies</h1>
<ul>
{% for movie in movies %}
<li>
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% for movie in movies %}
{% endfor %}
---
1
layout: base
2
title: Studio Ghibli movies
3
---
4
5
<h1>Studio Ghibli movies</h1>
6
7
<ul>
8
9
<li>
10
<a href="/movie/{{ movie.title | slug }">
11
{{ movie.title }}
12
</a>
13
</li>
14
15
</ul>
16
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
---
1
layout: base
2
title: Studio Ghibli movies
3
---
4
5
<h1>Studio Ghibli movies</h1>
6
7
<ul>
8
{% for movie in movies %}
9
<li>
10
11
12
13
</li>
14
{% endfor %}
15
</ul>
16
---
layout: base
title: Studio Ghibli movies
---
<h1>Studio Ghibli movies</h1>
<ul>
{% for movie in movies %}
<li>
<a href="/movie/{{ movie.title | slug }">
{{ movie.title }}
</a>
</li>
{% endfor %}
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 35
@loige
36
@loige
PAGINATION API
Allows to split collections into multiple pages
But it can also be used to generate pages for dynamic content
For instance, a page for every single movie
37
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
pagination:
data: movies
size: 1
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
4
5
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
pagination:
data: movies
size: 1
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
4
5
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
data: movies
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
pagination:
data: movies
size: 1
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
4
5
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
data: movies
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
size: 1
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
pagination:
data: movies
size: 1
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
4
5
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
data: movies
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
size: 1
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
size: 1
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
pagination:
data: movies
size: 1
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
4
5
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
data: movies
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
size: 1
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
size: 1
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
<h2>{{ movie.title }}</h2>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
<p>{{ movie.description }}</p>
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
9
10
<ul>
11
12
13
14
</ul>
15
16
17
18
<p><a href="/movies">See all movies</a></p>
19 38
@loige
PAGINATION API
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
permalink: /movie/{{ movie.title | slug }}/
---
1
layout: base
2
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
pagination:
data: movies
size: 1
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
4
5
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
data: movies
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
5
size: 1
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
size: 1
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
6
alias: movie
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
alias: movie
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
size: 1
6
7
---
8
<h2>{{ movie.title }}</h2>
9
10
<ul>
11
<li>Released in <strong>{{ movie.release_date }}</strong></li>
12
<li>Directed by <strong>{{ movie.director }}</strong></li>
13
<li>Produced by <strong>{{ movie.producer }}</strong></li>
14
</ul>
15
16
<p>{{ movie.description }}</p>
17
18
<p><a href="/movies">See all movies</a></p>
19
<h2>{{ movie.title }}</h2>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
<p>{{ movie.description }}</p>
---
1
layout: base
2
permalink: /movie/{{ movie.title | slug }}/
3
pagination:
4
data: movies
5
size: 1
6
alias: movie
7
---
8
9
10
<ul>
11
12
13
14
</ul>
15
16
17
18
<p><a href="/movies">See all movies</a></p>
19
---
layout: base
permalink: /movie/{{ movie.title | slug }}/
pagination:
data: movies
size: 1
alias: movie
---
<h2>{{ movie.title }}</h2>
<ul>
<li>Released in <strong>{{ movie.release_date }}</strong></li>
<li>Directed by <strong>{{ movie.director }}</strong></li>
<li>Produced by <strong>{{ movie.producer }}</strong></li>
</ul>
<p>{{ movie.description }}</p>
<p><a href="/movies">See all movies</a></p>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 38
@loige
39
loige.link/11ty-11min
40
BONUS! AUTOMATE DEPLOYMENT
Example using GitHub actions:
loige.link/11ty-ci-example
@loige
41
THANKS!
Icons by  and  on
Freepik Zlatko Najdenovski Pixelbuddha
If you enjoyed this talk, you
might also enjoy
 😛
nodejsdp.link
@loige
Let's connect!
  (blog)
  (twitter)
  (github)
loige.co
@loige
lmammino
loige.link/11ty-jam
20% eBook discount on Packt
20NODEMAY
42

More Related Content

What's hot

GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPPavel Tyk
 
WebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみたWebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみたonozaty
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony AppsPablo Godel
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpMatthew Davis
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)Kyle Lin
 
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016Loïc Knuchel
 
Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as codeJulian Simpson
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositoriesJulien Pivotto
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)SeongJae Park
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceBo-Yi Wu
 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupaldrubb
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internallySeongJae Park
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP ApplicationsPavan Kumar N
 

What's hot (20)

GIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APPGIT, RVM, FIRST HEROKU APP
GIT, RVM, FIRST HEROKU APP
 
WebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみたWebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみた
 
Php task runners
Php task runnersPhp task runners
Php task runners
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and GulpOptimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)
 
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
 
Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as code
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositories
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Let the contribution begin (EST futures)
Let the contribution begin  (EST futures)Let the contribution begin  (EST futures)
Let the contribution begin (EST futures)
 
Grails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLTGrails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLT
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript Conference
 
Take a Stroll in the Bazaar
Take a Stroll in the BazaarTake a Stroll in the Bazaar
Take a Stroll in the Bazaar
 
Development Principles & Philosophy
Development Principles & PhilosophyDevelopment Principles & Philosophy
Development Principles & Philosophy
 
Composer & Drupal
Composer & DrupalComposer & Drupal
Composer & Drupal
 
Deep dark-side of git: How git works internally
Deep dark-side of git: How git works internallyDeep dark-side of git: How git works internally
Deep dark-side of git: How git works internally
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 

Similar to An intro to the JAMStack and Eleventy

Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budgetDavid Lukac
 
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...NETWAYS
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016Susan Potter
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Bram Adams
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsSadayuki Furuhashi
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Mohamad Hassan
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hopeMarcus Ramberg
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshopAssaf Gannon
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP applicationJavier López
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with ServerlessYan Cui
 
Habitat hack slides - Infracoders Meetup Graz
Habitat hack slides - Infracoders Meetup GrazHabitat hack slides - Infracoders Meetup Graz
Habitat hack slides - Infracoders Meetup GrazInfralovers
 
Enabling Microservice @ Orbitz - GOTO Chicago 2016
Enabling Microservice @ Orbitz - GOTO Chicago 2016Enabling Microservice @ Orbitz - GOTO Chicago 2016
Enabling Microservice @ Orbitz - GOTO Chicago 2016Steve Hoffman
 
Makefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matterMakefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matterSimon Brüggen
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Dana Luther
 
Buildout: Fostering Repeatability
Buildout: Fostering RepeatabilityBuildout: Fostering Repeatability
Buildout: Fostering RepeatabilityClayton Parker
 
ngManila - Codename: Fireball - Hello World in Angular
ngManila - Codename: Fireball - Hello World in AngularngManila - Codename: Fireball - Hello World in Angular
ngManila - Codename: Fireball - Hello World in Angularngmanila
 

Similar to An intro to the JAMStack and Eleventy (20)

Automatisation in development and testing - within budget
Automatisation in development and testing - within budgetAutomatisation in development and testing - within budget
Automatisation in development and testing - within budget
 
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
OSDC 2014: Ole Michaelis & Sönke Rümpler: Make it SOLID - Software Architectu...
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!
 
Mojolicious lite
Mojolicious liteMojolicious lite
Mojolicious lite
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017Splunk n-box-splunk conf-2017
Splunk n-box-splunk conf-2017
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with Serverless
 
Habitat hack slides - Infracoders Meetup Graz
Habitat hack slides - Infracoders Meetup GrazHabitat hack slides - Infracoders Meetup Graz
Habitat hack slides - Infracoders Meetup Graz
 
Enabling Microservice @ Orbitz - GOTO Chicago 2016
Enabling Microservice @ Orbitz - GOTO Chicago 2016Enabling Microservice @ Orbitz - GOTO Chicago 2016
Enabling Microservice @ Orbitz - GOTO Chicago 2016
 
Makefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matterMakefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matter
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Fun with Ruby and Cocoa
Fun with Ruby and CocoaFun with Ruby and Cocoa
Fun with Ruby and Cocoa
 
Buildout: Fostering Repeatability
Buildout: Fostering RepeatabilityBuildout: Fostering Repeatability
Buildout: Fostering Repeatability
 
ngManila - Codename: Fireball - Hello World in Angular
ngManila - Codename: Fireball - Hello World in AngularngManila - Codename: Fireball - Hello World in Angular
ngManila - Codename: Fireball - Hello World in Angular
 

More from Luciano Mammino

Did you know JavaScript has iterators? DublinJS
Did you know JavaScript has iterators? DublinJSDid you know JavaScript has iterators? DublinJS
Did you know JavaScript has iterators? DublinJSLuciano Mammino
 
What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...
What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...
What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...Luciano Mammino
 
Building an invite-only microsite with Next.js & Airtable - ReactJS Milano
Building an invite-only microsite with Next.js & Airtable - ReactJS MilanoBuilding an invite-only microsite with Next.js & Airtable - ReactJS Milano
Building an invite-only microsite with Next.js & Airtable - ReactJS MilanoLuciano Mammino
 
From Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiperFrom Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiperLuciano Mammino
 
Let's build a 0-cost invite-only website with Next.js and Airtable!
Let's build a 0-cost invite-only website with Next.js and Airtable!Let's build a 0-cost invite-only website with Next.js and Airtable!
Let's build a 0-cost invite-only website with Next.js and Airtable!Luciano Mammino
 
Everything I know about S3 pre-signed URLs
Everything I know about S3 pre-signed URLsEverything I know about S3 pre-signed URLs
Everything I know about S3 pre-signed URLsLuciano Mammino
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance ComputingLuciano Mammino
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance ComputingLuciano Mammino
 
JavaScript Iteration Protocols - Workshop NodeConf EU 2022
JavaScript Iteration Protocols - Workshop NodeConf EU 2022JavaScript Iteration Protocols - Workshop NodeConf EU 2022
JavaScript Iteration Protocols - Workshop NodeConf EU 2022Luciano Mammino
 
Building an invite-only microsite with Next.js & Airtable
Building an invite-only microsite with Next.js & AirtableBuilding an invite-only microsite with Next.js & Airtable
Building an invite-only microsite with Next.js & AirtableLuciano Mammino
 
Let's take the monolith to the cloud 🚀
Let's take the monolith to the cloud 🚀Let's take the monolith to the cloud 🚀
Let's take the monolith to the cloud 🚀Luciano Mammino
 
A look inside the European Covid Green Certificate - Rust Dublin
A look inside the European Covid Green Certificate - Rust DublinA look inside the European Covid Green Certificate - Rust Dublin
A look inside the European Covid Green Certificate - Rust DublinLuciano Mammino
 
Node.js: scalability tips - Azure Dev Community Vijayawada
Node.js: scalability tips - Azure Dev Community VijayawadaNode.js: scalability tips - Azure Dev Community Vijayawada
Node.js: scalability tips - Azure Dev Community VijayawadaLuciano Mammino
 
A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)Luciano Mammino
 
AWS Observability Made Simple
AWS Observability Made SimpleAWS Observability Made Simple
AWS Observability Made SimpleLuciano Mammino
 
Semplificare l'observability per progetti Serverless
Semplificare l'observability per progetti ServerlessSemplificare l'observability per progetti Serverless
Semplificare l'observability per progetti ServerlessLuciano Mammino
 
Finding a lost song with Node.js and async iterators - NodeConf Remote 2021
Finding a lost song with Node.js and async iterators - NodeConf Remote 2021Finding a lost song with Node.js and async iterators - NodeConf Remote 2021
Finding a lost song with Node.js and async iterators - NodeConf Remote 2021Luciano Mammino
 
Finding a lost song with Node.js and async iterators - EnterJS 2021
Finding a lost song with Node.js and async iterators - EnterJS 2021Finding a lost song with Node.js and async iterators - EnterJS 2021
Finding a lost song with Node.js and async iterators - EnterJS 2021Luciano Mammino
 

More from Luciano Mammino (20)

Did you know JavaScript has iterators? DublinJS
Did you know JavaScript has iterators? DublinJSDid you know JavaScript has iterators? DublinJS
Did you know JavaScript has iterators? DublinJS
 
What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...
What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...
What I learned by solving 50 Advent of Code challenges in Rust - RustNation U...
 
Building an invite-only microsite with Next.js & Airtable - ReactJS Milano
Building an invite-only microsite with Next.js & Airtable - ReactJS MilanoBuilding an invite-only microsite with Next.js & Airtable - ReactJS Milano
Building an invite-only microsite with Next.js & Airtable - ReactJS Milano
 
From Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiperFrom Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiper
 
Let's build a 0-cost invite-only website with Next.js and Airtable!
Let's build a 0-cost invite-only website with Next.js and Airtable!Let's build a 0-cost invite-only website with Next.js and Airtable!
Let's build a 0-cost invite-only website with Next.js and Airtable!
 
Everything I know about S3 pre-signed URLs
Everything I know about S3 pre-signed URLsEverything I know about S3 pre-signed URLs
Everything I know about S3 pre-signed URLs
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
Serverless for High Performance Computing
Serverless for High Performance ComputingServerless for High Performance Computing
Serverless for High Performance Computing
 
JavaScript Iteration Protocols - Workshop NodeConf EU 2022
JavaScript Iteration Protocols - Workshop NodeConf EU 2022JavaScript Iteration Protocols - Workshop NodeConf EU 2022
JavaScript Iteration Protocols - Workshop NodeConf EU 2022
 
Building an invite-only microsite with Next.js & Airtable
Building an invite-only microsite with Next.js & AirtableBuilding an invite-only microsite with Next.js & Airtable
Building an invite-only microsite with Next.js & Airtable
 
Let's take the monolith to the cloud 🚀
Let's take the monolith to the cloud 🚀Let's take the monolith to the cloud 🚀
Let's take the monolith to the cloud 🚀
 
A look inside the European Covid Green Certificate - Rust Dublin
A look inside the European Covid Green Certificate - Rust DublinA look inside the European Covid Green Certificate - Rust Dublin
A look inside the European Covid Green Certificate - Rust Dublin
 
Monoliths to the cloud!
Monoliths to the cloud!Monoliths to the cloud!
Monoliths to the cloud!
 
The senior dev
The senior devThe senior dev
The senior dev
 
Node.js: scalability tips - Azure Dev Community Vijayawada
Node.js: scalability tips - Azure Dev Community VijayawadaNode.js: scalability tips - Azure Dev Community Vijayawada
Node.js: scalability tips - Azure Dev Community Vijayawada
 
A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)A look inside the European Covid Green Certificate (Codemotion 2021)
A look inside the European Covid Green Certificate (Codemotion 2021)
 
AWS Observability Made Simple
AWS Observability Made SimpleAWS Observability Made Simple
AWS Observability Made Simple
 
Semplificare l'observability per progetti Serverless
Semplificare l'observability per progetti ServerlessSemplificare l'observability per progetti Serverless
Semplificare l'observability per progetti Serverless
 
Finding a lost song with Node.js and async iterators - NodeConf Remote 2021
Finding a lost song with Node.js and async iterators - NodeConf Remote 2021Finding a lost song with Node.js and async iterators - NodeConf Remote 2021
Finding a lost song with Node.js and async iterators - NodeConf Remote 2021
 
Finding a lost song with Node.js and async iterators - EnterJS 2021
Finding a lost song with Node.js and async iterators - EnterJS 2021Finding a lost song with Node.js and async iterators - EnterJS 2021
Finding a lost song with Node.js and async iterators - EnterJS 2021
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

An intro to the JAMStack and Eleventy

  • 1. AN INTRO TO THE JAMSTACK & ELEVENTY Luciano Mammino ( ) @loige loige.link/11ty-jam May 18, 19, 20 - 2021 1
  • 3. STATIC SITE GENERATORS... WAIT, WHAT?! content & templates static HTML pages & assets This is the core of a static site generator! @loige 3
  • 4. WHAT ARE WE TALKING ABOUT? I NEED EXAMPLES! A programming blog A recipes website A movie reviews website A photo book An online portfolio A podcast website ... And even single-page applications! @loige 4
  • 5. LET ME INTRODUCE MYSELF... @loige 5
  • 6. LET ME INTRODUCE MYSELF... I'm Luciano ( 🍕🍝) 👋 @loige 5
  • 7. LET ME INTRODUCE MYSELF... I'm Luciano ( 🍕🍝) 👋  Senior Architect @loige 5
  • 8. LET ME INTRODUCE MYSELF... I'm Luciano ( 🍕🍝) 👋  Senior Architect nodejsdp.link Co-Author of Node.js Design Patterns  👉 @loige 5
  • 9. LET ME INTRODUCE MYSELF... I'm Luciano ( 🍕🍝) 👋  Senior Architect nodejsdp.link Co-Author of Node.js Design Patterns  👉 Connect with me:     (blog)   (twitter)   (github) loige.co @loige lmammino @loige 20% eBook discount on Packt 20NODEMAY 5
  • 10. WE ARE BUSINESS FOCUSED TECHNOLOGISTS THAT DELIVER.  |  | Accelerated Serverless AI as a Service Platform Modernisation Do you want to ? work with us loige 6
  • 11. SOME STATIC SITES I BUILT loige.co open source! @loige 7
  • 14. @loige A Java API client! 10
  • 15. WHY DO WE CARE? It's easy It's generally cheap It can scale easily It can be more secure We can build fast websites We can still use dynamic data (API, CMS, etc.) We can still add dynamic features @loige 11
  • 16. WHICH TOOL SHOULD I USE? jamstack.org/generators/ +350 tools listed! @loige 12
  • 17. WHY DO I LIKE ELEVENTY? It's written in Node.js It's so simple that you don't need a "starter" (but there are if you want) Fast & lightweight Not opinionated Simple to build incrementally on top of it Makes me feel productive... many @loige 13
  • 18. OK. NOW, LET'S PLAY WITH ELEVENTY! Install + Hello world Custom config Templates, frontmatter & Layouts Live reload Copying static files Custom global data Collection API Using dynamic data Pagination API @loige 14
  • 19. mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 @loige PROJECT SCAFFOLD 15
  • 20. mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 mkdir 11ty-sample-project cd 11ty-sample-project npm init -y 1 2 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 @loige PROJECT SCAFFOLD 15
  • 21. mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 mkdir 11ty-sample-project cd 11ty-sample-project npm init -y 1 2 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 npm i --save-dev @11ty/eleventy mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 @loige PROJECT SCAFFOLD 15
  • 22. mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 mkdir 11ty-sample-project cd 11ty-sample-project npm init -y 1 2 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 npm i --save-dev @11ty/eleventy mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 echo "# My sample Eleventy website" > index.md mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 npm i --save-dev @11ty/eleventy 5 6 7 8 node_modules/.bin/eleventy --watch --serve 9 @loige PROJECT SCAFFOLD 15
  • 23. mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 mkdir 11ty-sample-project cd 11ty-sample-project npm init -y 1 2 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 npm i --save-dev @11ty/eleventy mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 echo "# My sample Eleventy website" > index.md mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 npm i --save-dev @11ty/eleventy 5 6 7 8 node_modules/.bin/eleventy --watch --serve 9 node_modules/.bin/eleventy --watch --serve mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 9 @loige PROJECT SCAFFOLD 15
  • 24. mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 mkdir 11ty-sample-project cd 11ty-sample-project npm init -y 1 2 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 npm i --save-dev @11ty/eleventy mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 5 6 echo "# My sample Eleventy website" > index.md 7 8 node_modules/.bin/eleventy --watch --serve 9 echo "# My sample Eleventy website" > index.md mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 npm i --save-dev @11ty/eleventy 5 6 7 8 node_modules/.bin/eleventy --watch --serve 9 node_modules/.bin/eleventy --watch --serve mkdir 11ty-sample-project 1 cd 11ty-sample-project 2 npm init -y 3 4 npm i --save-dev @11ty/eleventy 5 6 echo "# My sample Eleventy website" > index.md 7 8 9 mkdir 11ty-sample-project cd 11ty-sample-project npm init -y npm i --save-dev @11ty/eleventy echo "# My sample Eleventy website" > index.md node_modules/.bin/eleventy --watch --serve 1 2 3 4 5 6 7 8 9 @loige PROJECT SCAFFOLD 15
  • 26. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 @loige CUSTOM CONFIG 17
  • 27. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 @loige CUSTOM CONFIG 17
  • 28. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 module.exports = function (config) { // .eleventy.js 1 2 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 @loige CUSTOM CONFIG 17
  • 29. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 module.exports = function (config) { // .eleventy.js 1 2 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 return { dir: { input: './src', // default: `.` output: './build' // default: _site } } // .eleventy.js 1 2 module.exports = function (config) { 3 4 5 6 7 8 9 } 10 @loige CUSTOM CONFIG 17
  • 30. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 module.exports = function (config) { // .eleventy.js 1 2 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 return { dir: { input: './src', // default: `.` output: './build' // default: _site } } // .eleventy.js 1 2 module.exports = function (config) { 3 4 5 6 7 8 9 } 10 input: './src', // default: `.` // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 6 output: './build' // default: _site 7 } 8 } 9 } 10 @loige CUSTOM CONFIG 17
  • 31. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 module.exports = function (config) { // .eleventy.js 1 2 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 return { dir: { input: './src', // default: `.` output: './build' // default: _site } } // .eleventy.js 1 2 module.exports = function (config) { 3 4 5 6 7 8 9 } 10 input: './src', // default: `.` // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 6 output: './build' // default: _site 7 } 8 } 9 } 10 output: './build' // default: _site // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 7 } 8 } 9 } 10 @loige CUSTOM CONFIG 17
  • 32. // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 module.exports = function (config) { // .eleventy.js 1 2 3 return { 4 dir: { 5 input: './src', // default: `.` 6 output: './build' // default: _site 7 } 8 } 9 } 10 return { dir: { input: './src', // default: `.` output: './build' // default: _site } } // .eleventy.js 1 2 module.exports = function (config) { 3 4 5 6 7 8 9 } 10 input: './src', // default: `.` // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 6 output: './build' // default: _site 7 } 8 } 9 } 10 output: './build' // default: _site // .eleventy.js 1 2 module.exports = function (config) { 3 return { 4 dir: { 5 input: './src', // default: `.` 6 7 } 8 } 9 } 10 // .eleventy.js module.exports = function (config) { return { dir: { input: './src', // default: `.` output: './build' // default: _site } } } 1 2 3 4 5 6 7 8 9 10 @loige CUSTOM CONFIG 17
  • 33. @loige TEMPLATES markdown (.md), Nunjucks (.njk) and  are called templates These files can be used as a skeleton to generate pages Eleventy will automatically search for them in our source folder and, by default, it will generate a page for each and every one of them many other file types 18
  • 34. @loige FRONTMATTER frontmatter is an optional section at the top of a template that can be used to define additional contextual metadata. --- name: someone age: 17 --- Rest of the file 19
  • 35. @loige FRONTMATTER Data in the frontmatter can be referenced in the templates --- name: someone age: 17 --- {{ name }} is {{ age }} years old! 20
  • 36. @loige LAYOUTS Layouts are used to wrap the generated pages in a common HTML structure Especially useful for Markdown files Layouts can also have a frontmatter 21
  • 37. --- title: My default title --- <!DOCTYPE html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>{{ title }}</title> </head> <body> <main> {{ content | safe }} </main> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 @loige src/_includes/base.njk 22
  • 38. --- title: My default title --- <!DOCTYPE html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>{{ title }}</title> </head> <body> <main> {{ content | safe }} </main> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 --- title: My default title --- 1 2 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 @loige src/_includes/base.njk 22
  • 39. --- title: My default title --- <!DOCTYPE html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>{{ title }}</title> </head> <body> <main> {{ content | safe }} </main> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 --- title: My default title --- 1 2 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 <title>{{ title }}</title> --- 1 title: My default title 2 --- 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 @loige src/_includes/base.njk 22
  • 40. --- title: My default title --- <!DOCTYPE html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>{{ title }}</title> </head> <body> <main> {{ content | safe }} </main> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 --- title: My default title --- 1 2 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 <title>{{ title }}</title> --- 1 title: My default title 2 --- 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 {{ content | safe }} --- 1 title: My default title 2 --- 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 </head> 9 <body> 10 <main> 11 12 </main> 13 </body> 14 </html> 15 @loige src/_includes/base.njk 22
  • 41. --- title: My default title --- <!DOCTYPE html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>{{ title }}</title> </head> <body> <main> {{ content | safe }} </main> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 --- title: My default title --- 1 2 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 <title>{{ title }}</title> --- 1 title: My default title 2 --- 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 8 </head> 9 <body> 10 <main> 11 {{ content | safe }} 12 </main> 13 </body> 14 </html> 15 {{ content | safe }} --- 1 title: My default title 2 --- 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 </head> 9 <body> 10 <main> 11 12 </main> 13 </body> 14 </html> 15 --- title: My default title --- <!DOCTYPE html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>{{ title }}</title> </head> <body> <main> {{ content | safe }} </main> </body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 @loige src/_includes/base.njk 22
  • 42. layout: base --- 1 2 --- 3 4 # Hello from Eleventy 5 6 This is a simple Eleventy demo 7 @loige To use a layout you can use the special frontmatter property "layout" in a template: 23
  • 43. @loige Eleventy uses to give you live-reload 🚀 BrowserSync 24
  • 44. @loige COPYING STATIC ASSETS src/_includes/style.css html, body { background-color: #eee; margin: 0; } main { box-sizing: border-box; max-width: 1024px; min-height: 100vh; padding: 2em; margin: 0 auto; background: white; } 25
  • 45. @loige COPYING STATIC ASSETS // .eleventy.js module.exports = function (config) { config.addPassthroughCopy({ './src/_includes/style.css': 'style.css' }) // ... } 1 2 3 4 5 6 7 8 9 26
  • 46. @loige COPYING STATIC ASSETS // .eleventy.js module.exports = function (config) { config.addPassthroughCopy({ './src/_includes/style.css': 'style.css' }) // ... } 1 2 3 4 5 6 7 8 9 config.addPassthroughCopy({ // .eleventy.js 1 2 module.exports = function (config) { 3 4 './src/_includes/style.css': 'style.css' 5 }) 6 7 // ... 8 } 9 26
  • 47. @loige COPYING STATIC ASSETS // .eleventy.js module.exports = function (config) { config.addPassthroughCopy({ './src/_includes/style.css': 'style.css' }) // ... } 1 2 3 4 5 6 7 8 9 config.addPassthroughCopy({ // .eleventy.js 1 2 module.exports = function (config) { 3 4 './src/_includes/style.css': 'style.css' 5 }) 6 7 // ... 8 } 9 './src/_includes/style.css': 'style.css' // .eleventy.js 1 2 module.exports = function (config) { 3 config.addPassthroughCopy({ 4 5 }) 6 7 // ... 8 } 9 26
  • 48. @loige COPYING STATIC ASSETS // .eleventy.js module.exports = function (config) { config.addPassthroughCopy({ './src/_includes/style.css': 'style.css' }) // ... } 1 2 3 4 5 6 7 8 9 config.addPassthroughCopy({ // .eleventy.js 1 2 module.exports = function (config) { 3 4 './src/_includes/style.css': 'style.css' 5 }) 6 7 // ... 8 } 9 './src/_includes/style.css': 'style.css' // .eleventy.js 1 2 module.exports = function (config) { 3 config.addPassthroughCopy({ 4 5 }) 6 7 // ... 8 } 9 // .eleventy.js module.exports = function (config) { config.addPassthroughCopy({ './src/_includes/style.css': 'style.css' }) // ... } 1 2 3 4 5 6 7 8 9 26
  • 49. <link rel="stylesheet" href="/style.css"/> --- 1 title: My default title 2 --- 3 <!DOCTYPE html> 4 <head> 5 <meta charset="utf-8"/> 6 <meta name="viewport" content="width=device-width, initial-scale=1"/> 7 <title>{{ title }}</title> 8 9 </head> 10 <body> 11 <main> 12 {{ content | safe }} 13 </main> 14 </body> 15 </html> 16 @loige src/_includes/base.njk 27
  • 50. @loige GLOBAL DATA FILES // src/_data/site.js module.exports = { author: 'Luciano Mammino', copyrightYear: (new Date()).getFullYear() } Define globally available data JavaScript code that gets executed before templates are rendered Can be static or dynamic (e.g. fetch data from an API or a DB) 28
  • 51. @loige GLOBAL DATA FILES A website by {{ site.author }} - &copy; {{ site.copyrightYear }} <main> 1 {{ content | safe }} 2 <hr/> 3 <small> 4 5 6 </small> 7 </main> 8 The filename defines how you access the data in templates 29
  • 52. @loige COLLECTION API tags: ["posts", "javascript"] --- 1 2 --- 3 4 ## An introduction to the spread syntax 5 6 **Spread syntax** (`...`) allows an iterable such as an array 7 expression or string to be expanded in places where zero or 8 more arguments (for function calls) or elements 9 (for array literals) are expected, or an object expression 10 to be expanded in places where zero or more 11 key-value pairs (for object literals) are expected. 12 You can tag a template to be part of one or more collections Use the special frontmatter entry "tags" 30
  • 53. @loige COLLECTION API --- title: "All posts" layout: base --- <h1>All posts</h1> <ul> {% for post in collections.posts %} <li> <a href="{{ post.url }}"> {{ post.data.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Eleventy allows you to access all the metadata of templates for a given tag using the special collections.tagName global data 31
  • 54. @loige COLLECTION API --- title: "All posts" layout: base --- <h1>All posts</h1> <ul> {% for post in collections.posts %} <li> <a href="{{ post.url }}"> {{ post.data.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% for post in collections.posts %} --- 1 title: "All posts" 2 layout: base 3 --- 4 5 <h1>All posts</h1> 6 7 <ul> 8 9 <li> 10 <a href="{{ post.url }}"> 11 {{ post.data.title }} 12 </a> 13 </li> 14 {% endfor %} 15 </ul> 16 Eleventy allows you to access all the metadata of templates for a given tag using the special collections.tagName global data 31
  • 55. @loige COLLECTION API --- title: "All posts" layout: base --- <h1>All posts</h1> <ul> {% for post in collections.posts %} <li> <a href="{{ post.url }}"> {{ post.data.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% for post in collections.posts %} --- 1 title: "All posts" 2 layout: base 3 --- 4 5 <h1>All posts</h1> 6 7 <ul> 8 9 <li> 10 <a href="{{ post.url }}"> 11 {{ post.data.title }} 12 </a> 13 </li> 14 {% endfor %} 15 </ul> 16 <a href="{{ post.url }}"> {{ post.data.title }} </a> --- 1 title: "All posts" 2 layout: base 3 --- 4 5 <h1>All posts</h1> 6 7 <ul> 8 {% for post in collections.posts %} 9 <li> 10 11 12 13 </li> 14 {% endfor %} 15 </ul> 16 Eleventy allows you to access all the metadata of templates for a given tag using the special collections.tagName global data 31
  • 56. @loige COLLECTION API --- title: "All posts" layout: base --- <h1>All posts</h1> <ul> {% for post in collections.posts %} <li> <a href="{{ post.url }}"> {{ post.data.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% for post in collections.posts %} --- 1 title: "All posts" 2 layout: base 3 --- 4 5 <h1>All posts</h1> 6 7 <ul> 8 9 <li> 10 <a href="{{ post.url }}"> 11 {{ post.data.title }} 12 </a> 13 </li> 14 {% endfor %} 15 </ul> 16 <a href="{{ post.url }}"> {{ post.data.title }} </a> --- 1 title: "All posts" 2 layout: base 3 --- 4 5 <h1>All posts</h1> 6 7 <ul> 8 {% for post in collections.posts %} 9 <li> 10 11 12 13 </li> 14 {% endfor %} 15 </ul> 16 --- title: "All posts" layout: base --- <h1>All posts</h1> <ul> {% for post in collections.posts %} <li> <a href="{{ post.url }}"> {{ post.data.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Eleventy allows you to access all the metadata of templates for a given tag using the special collections.tagName global data 31
  • 58. @loige USING DYNAMIC DATA npm i --save-dev @11ty/eleventy-cache-assets What if we want to build a website using data from an API? For instance this one: https://ghibliapi.herokuapp.com/films/ We don't want to fetch the data after every single change! 33
  • 59. @loige USING DYNAMIC DATA // src/_data/movies.js const Cache = require('@11ty/eleventy-cache-assets') module.exports = async function () { return Cache( 'https://ghibliapi.herokuapp.com/films/', { type: 'json' } ) } 1 2 3 4 5 6 7 8 9 10 34
  • 60. @loige USING DYNAMIC DATA // src/_data/movies.js const Cache = require('@11ty/eleventy-cache-assets') module.exports = async function () { return Cache( 'https://ghibliapi.herokuapp.com/films/', { type: 'json' } ) } 1 2 3 4 5 6 7 8 9 10 return Cache( 'https://ghibliapi.herokuapp.com/films/', { type: 'json' } ) // src/_data/movies.js 1 2 const Cache = require('@11ty/eleventy-cache-assets') 3 4 module.exports = async function () { 5 6 7 8 9 } 10 34
  • 61. @loige USING DYNAMIC DATA // src/_data/movies.js const Cache = require('@11ty/eleventy-cache-assets') module.exports = async function () { return Cache( 'https://ghibliapi.herokuapp.com/films/', { type: 'json' } ) } 1 2 3 4 5 6 7 8 9 10 return Cache( 'https://ghibliapi.herokuapp.com/films/', { type: 'json' } ) // src/_data/movies.js 1 2 const Cache = require('@11ty/eleventy-cache-assets') 3 4 module.exports = async function () { 5 6 7 8 9 } 10 // src/_data/movies.js const Cache = require('@11ty/eleventy-cache-assets') module.exports = async function () { return Cache( 'https://ghibliapi.herokuapp.com/films/', { type: 'json' } ) } 1 2 3 4 5 6 7 8 9 10 34
  • 62. @loige USING DYNAMIC DATA --- layout: base title: Studio Ghibli movies --- <h1>Studio Ghibli movies</h1> <ul> {% for movie in movies %} <li> <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 35
  • 63. @loige USING DYNAMIC DATA --- layout: base title: Studio Ghibli movies --- <h1>Studio Ghibli movies</h1> <ul> {% for movie in movies %} <li> <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% for movie in movies %} {% endfor %} --- 1 layout: base 2 title: Studio Ghibli movies 3 --- 4 5 <h1>Studio Ghibli movies</h1> 6 7 <ul> 8 9 <li> 10 <a href="/movie/{{ movie.title | slug }"> 11 {{ movie.title }} 12 </a> 13 </li> 14 15 </ul> 16 35
  • 64. @loige USING DYNAMIC DATA --- layout: base title: Studio Ghibli movies --- <h1>Studio Ghibli movies</h1> <ul> {% for movie in movies %} <li> <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% for movie in movies %} {% endfor %} --- 1 layout: base 2 title: Studio Ghibli movies 3 --- 4 5 <h1>Studio Ghibli movies</h1> 6 7 <ul> 8 9 <li> 10 <a href="/movie/{{ movie.title | slug }"> 11 {{ movie.title }} 12 </a> 13 </li> 14 15 </ul> 16 <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> --- 1 layout: base 2 title: Studio Ghibli movies 3 --- 4 5 <h1>Studio Ghibli movies</h1> 6 7 <ul> 8 {% for movie in movies %} 9 <li> 10 11 12 13 </li> 14 {% endfor %} 15 </ul> 16 35
  • 65. @loige USING DYNAMIC DATA --- layout: base title: Studio Ghibli movies --- <h1>Studio Ghibli movies</h1> <ul> {% for movie in movies %} <li> <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 {% for movie in movies %} {% endfor %} --- 1 layout: base 2 title: Studio Ghibli movies 3 --- 4 5 <h1>Studio Ghibli movies</h1> 6 7 <ul> 8 9 <li> 10 <a href="/movie/{{ movie.title | slug }"> 11 {{ movie.title }} 12 </a> 13 </li> 14 15 </ul> 16 <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> --- 1 layout: base 2 title: Studio Ghibli movies 3 --- 4 5 <h1>Studio Ghibli movies</h1> 6 7 <ul> 8 {% for movie in movies %} 9 <li> 10 11 12 13 </li> 14 {% endfor %} 15 </ul> 16 --- layout: base title: Studio Ghibli movies --- <h1>Studio Ghibli movies</h1> <ul> {% for movie in movies %} <li> <a href="/movie/{{ movie.title | slug }"> {{ movie.title }} </a> </li> {% endfor %} </ul> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 35
  • 67. @loige PAGINATION API Allows to split collections into multiple pages But it can also be used to generate pages for dynamic content For instance, a page for every single movie 37
  • 68. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 38
  • 69. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 38
  • 70. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 pagination: data: movies size: 1 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 4 5 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 38
  • 71. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 pagination: data: movies size: 1 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 4 5 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 data: movies --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 38
  • 72. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 pagination: data: movies size: 1 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 4 5 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 data: movies --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 size: 1 --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 38
  • 73. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 pagination: data: movies size: 1 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 4 5 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 data: movies --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 size: 1 --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 size: 1 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 38
  • 74. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 pagination: data: movies size: 1 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 4 5 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 data: movies --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 size: 1 --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 size: 1 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 <h2>{{ movie.title }}</h2> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> <p>{{ movie.description }}</p> --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 9 10 <ul> 11 12 13 14 </ul> 15 16 17 18 <p><a href="/movies">See all movies</a></p> 19 38
  • 75. @loige PAGINATION API --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 permalink: /movie/{{ movie.title | slug }}/ --- 1 layout: base 2 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 pagination: data: movies size: 1 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 4 5 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 data: movies --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 5 size: 1 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 size: 1 --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 6 alias: movie 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 alias: movie --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 size: 1 6 7 --- 8 <h2>{{ movie.title }}</h2> 9 10 <ul> 11 <li>Released in <strong>{{ movie.release_date }}</strong></li> 12 <li>Directed by <strong>{{ movie.director }}</strong></li> 13 <li>Produced by <strong>{{ movie.producer }}</strong></li> 14 </ul> 15 16 <p>{{ movie.description }}</p> 17 18 <p><a href="/movies">See all movies</a></p> 19 <h2>{{ movie.title }}</h2> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> <p>{{ movie.description }}</p> --- 1 layout: base 2 permalink: /movie/{{ movie.title | slug }}/ 3 pagination: 4 data: movies 5 size: 1 6 alias: movie 7 --- 8 9 10 <ul> 11 12 13 14 </ul> 15 16 17 18 <p><a href="/movies">See all movies</a></p> 19 --- layout: base permalink: /movie/{{ movie.title | slug }}/ pagination: data: movies size: 1 alias: movie --- <h2>{{ movie.title }}</h2> <ul> <li>Released in <strong>{{ movie.release_date }}</strong></li> <li>Directed by <strong>{{ movie.director }}</strong></li> <li>Produced by <strong>{{ movie.producer }}</strong></li> </ul> <p>{{ movie.description }}</p> <p><a href="/movies">See all movies</a></p> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 38
  • 78. BONUS! AUTOMATE DEPLOYMENT Example using GitHub actions: loige.link/11ty-ci-example @loige 41
  • 79. THANKS! Icons by  and  on Freepik Zlatko Najdenovski Pixelbuddha If you enjoyed this talk, you might also enjoy  😛 nodejsdp.link @loige Let's connect!   (blog)   (twitter)   (github) loige.co @loige lmammino loige.link/11ty-jam 20% eBook discount on Packt 20NODEMAY 42