SlideShare a Scribd company logo
1 of 60
Download to read offline
Eleventy
aka 11ty
webmardi.ch
6 juillet 2021
By Gilles Vauvarin
● Blog : pixenjoy.com
● Twitter : @pixenjoy
● Side project : thewhale.cc
● Twitter : @thewhalecc
● Mastodon : thewhalecc@framapiaf.org
● Side project : k-review.com
● Stack :
- HTML, CSS (TailwindCSS)
- JS (Svelte, AlpineJS)
- NodeJS (AdonisJS)
- CMS (Kirby)
- JAMstack (11ty)
Hey !
Gilles Vauvarin
Web developer
Evolution of web architectures ...
Dynamic
monolithic sites
CGI, PHP, CMS, BDD, Back
Frameworks ...
1993
1989
2005
HTML pages
Birth of the web,
hypertextes links
SPA, JAMstack ...
SPA, Headless CMS, API, SSG,
Front Frameworks, PWA ...
1996: HTML pages
Request: “http://site.com/page.html”
Response: <html><body> ...
SERVER BROWSER
page.html
page1.html
page2.html
page3.html
page4.html
...
1989: Dynamic monolithic sites
Request: “http://site.com/page”
Response: <html><body> ...
SERVER
BROWSER
Template
page.php
PHP BDD
Query SQL
2005: JAMstack > SSG > build step
SSG
Ex: Eleventy
Template :
page.njk
Data :
Markdown,
JSON,
BDD (API)
page1.html
page2.html
page3.html
page4.html
...
Build on server
+
2005: JAMstack > CDN > disponibility
Request: “http://site.com/page.html”
Response: <html><body> ...
CDN
SERVER
BROWSER
page1.html
page2.html
page3.html
page4.html
...
Eleventy
Static web sites
JAMstack
JS - API - Markup
SSG
Static Site Generator
Why are we interested in
static sites?
Eco-design
(consumes less server resources)
Security
(no server-side, no DB)
Cost reduction
(Hosting, maintenance)
Performance
(if well implemented!, CDN)
Eleventy’s author
Web Developer for
Netlify
Zach Leatherman
https://github.com/11ty/eleventy
Eleventy’s
characteristics
NodeJS, packages npm
Not a framework
But an HTML generator
Flexible
Templates, Folders, Data
JavaScript
01 02
03
Some key concepts of Eleventy
01
Front matter
02
Template
03
Layout
04
Collection
05
Files architecture
06
Data cascade
07
Plugin & Filter
08
Data
09
Installation &
deployment
01
Front Matter
Metadata in front page
Front Matter quesako ?
- Instruction block composed of key/value and located in the header of
templates.
- Allows you to indicate instructions to Eleventy and to pass data to the
templates.
- Written in JSON, JavaScript or YAML. You can even add your own format!
example.njk
02
Template
Content in different forms
Template quesako ?
- Templates are content files formatted via a tag system (HTML, Markdown)
or a more advanced templating language (Handlebars, Mustache, Liquid,
Nunjucks ...). Eleventy support 11 templating language !
- These templates indicate how the content and data should be used in the
pages that will be built by Eleventy.
template.njk
What we can do with Nunjucks?
It’s like HTML with super power !
03
Layout
Content in content
Layout quesako ?
- Layouts are special templates for wrapping content in other content. It’s
quite similar to <slot> if you use a JS framework like React, Vue, Svelte ...
- Their use is optional, as templating languages like Nunjuncks have similar
functions.
mylayout.njk
content.md
index.html
04
Collection
Categorize content
Collection quesako ?
- A collection allows you to group content.
- Use the keyword “tags” in the frontmatter to attach a content in a collection.
- We can loop through a collection to display all their items.
- You can attach a content to several collection.
post.md
post.njk
05
Folders & Files
How is the file system organized in Eleventy?
Folders & Files
By default all files in the root project folder will be compiled into the _site
directory.
root_project_folder
├── assets
├── file.md
├── file.njk
└── _site
Use an .eleventyignore file to let eleventy know which files you do not want to
compile.
Folders & Files
To copy your assets in the final static website, use addPassthroughCopy
root_project_folder / .eleventy.js
Folders & Files
root_project_folder / .eleventy.js
Custom files system:
06
Data Cascade
Read the data in a certain order
Data cascade quesako ?
- The data, depending on their origin, are read in a certain order and with a
certain priority.
We distinguish :
- Global data
- Data files that apply to a folder
- Data files that apply to a template
- The frontmatter data of a layout
- The frontmatter data of a template
- Computed data
https://benmyers.dev/blog/eleventy-data-cascade/
07
Plugin & Filters
Extend functionality and apply filters to content
Plugins
- They allow to extend the functionalities of 11ty
- Step 1: install the plugin in your 11ty project via npm
- Step 2: call the plugin in your 11ty config file (.eleventy.js)
- Do something at the built step
- Examples:
> generate a RSS feed
> manage images optimization
> manage syntax highlighting ...
Plugins
- Step 1: in a terminal
- Step 2 : in your config file .eleventy.js
Filters
- They allow to modify a content
- Template language comes with built in filters
- Custom filter > definition of a "filterName" function in the .eleventy.js file
- Used in a template like this : {{ myContent | filterName }}
Filters
root_project_folder / .eleventy.js
Filters
root_project_folder / input / page.njk
08
Data
How to fetch data?
From files or an API
- Eleventy can work with data coming from different sources :
> Local files (md, html, templates …)
> Local data (frontmatter, global data …)
> External source (external API, Headless CMS API)
Data from an
external API
my-root-project/input/
_data/about.js
Data from an
external API
my-root-project/input/
about/about.njk
09
Installation
& Deployment
How to install & deploy Eleventy?
Installation
NodeJS (v.10 min) and npm are required
Installation
In your terminal :
Installation
How to run eleventy now ?
Deployment
Static files are easy to deploy ...
Vercel
Netlify Cloudflare pages
Deployment
- Version your project in a Git repository (Github, Gitlab, Bitbucket …).
- Choose a hosting company (Netlify, Vercel …).
- Link Netlify or whatever to your Git repository (dashboard).
- Allow Netlify or whatever and your Git platform to talk to each other (Git
platform SSH).
- Select your static site from your Git platform (dashboard).
- Configure your settings: branch, publish directory (dashboard).
- Use a build hook to watch your update on your Git repository and trigger an
automatic deployment.
Static sites ...
for which type of projects?
- Content Website (up to a certain size)
- Website with few daily update
Corporate website, documentation, blog, landing
page, portfolio, agency website ... and many more.
> 80% of Web ?
Eleventy
- Pretty fast build times.
- Zero-config by default but has flexible configuration
options.
- Works with your project’s existing directory structure.
- Node/javaScript ecosystem.
- Output pur HTML/CSS.
- Works with multiple template languages.
- Great use of data files/sources.
- OpenSource.
Con
Pro
- Sparse documentation.
- Limited tooling, community, tutorials.
- Not for very big website (build time, deployment)
- Do not manage dynamic part.
- You have to know how to write code to publish
content by default (Markdown).
Mixing static and dynamic
Meta frameworks
Next, Nuxt, Sveltekit, Astro ...
Headless CMS
Strapi, WP, Kirby, Forestry ...
Serverless functions
Netlify, Vercel, Cloudflare ...
Questions ?
● Blog : pixenjoy.com
● Twitter : @pixenjoy
● Side project : thewhale.cc
● Twitter : @thewhalecc
● Mastodon : thewhalecc@framapiaf.org
● Side project : k-review.com
Gilles Vauvarin
CREDITS: This presentation template was created
by Slidesgo, including icons by Flaticon, and
infographics & images by Freepik
THANKS

More Related Content

What's hot

WordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshopWordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshopJonny Allbut
 
0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar
0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar
0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntarGeneXus
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKitJoone Hur
 
Drupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsDrupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsIztok Smolic
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme developmentJonny Allbut
 
Web Standards Support in WebKit
Web Standards Support in WebKitWeb Standards Support in WebKit
Web Standards Support in WebKitJoone Hur
 
Mediawiki as a software documentation CMS
Mediawiki as a software documentation CMSMediawiki as a software documentation CMS
Mediawiki as a software documentation CMSBarry Grenon
 
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...Igalia
 
WordCamp Birmingham 2015 - Theme building tricks of the trade
WordCamp Birmingham 2015 - Theme building tricks of the tradeWordCamp Birmingham 2015 - Theme building tricks of the trade
WordCamp Birmingham 2015 - Theme building tricks of the tradeJonny Allbut
 
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...Igalia
 
Decoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCRDecoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCRHenri Bergius
 
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)Igalia
 
Korea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklimKorea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklimSang Seok Lim
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5DrupalDay
 
Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0Jason Smith
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolutionjuanjosanchezpenas
 

What's hot (20)

Flexbox
FlexboxFlexbox
Flexbox
 
WordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshopWordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshop
 
0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar
0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar
0025 todo lo_que_queria_saber_de_html5_y_no_se_animaba_a_preguntar
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
 
Drupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 monthsDrupal 8, tricks and tips learned from the first 6 months
Drupal 8, tricks and tips learned from the first 6 months
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme development
 
Web Standards Support in WebKit
Web Standards Support in WebKitWeb Standards Support in WebKit
Web Standards Support in WebKit
 
Mediawiki as a software documentation CMS
Mediawiki as a software documentation CMSMediawiki as a software documentation CMS
Mediawiki as a software documentation CMS
 
Html5 phillycc
Html5 phillyccHtml5 phillycc
Html5 phillycc
 
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
 
WordCamp Birmingham 2015 - Theme building tricks of the trade
WordCamp Birmingham 2015 - Theme building tricks of the tradeWordCamp Birmingham 2015 - Theme building tricks of the trade
WordCamp Birmingham 2015 - Theme building tricks of the trade
 
SnapyX - ParisJS
SnapyX - ParisJSSnapyX - ParisJS
SnapyX - ParisJS
 
The WebKit project
The WebKit projectThe WebKit project
The WebKit project
 
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
 
Decoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCRDecoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCR
 
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
 
Korea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklimKorea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklim
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
 
Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0Multi-content Containers in dotCMS 3.0
Multi-content Containers in dotCMS 3.0
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
 

Similar to Présentation du générateur de site statique eleventy

Contentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopContentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopIvo Lukac
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratchtutorialsruby
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratchtutorialsruby
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
HAXTheWeb @ Apereo 19
HAXTheWeb @ Apereo 19HAXTheWeb @ Apereo 19
HAXTheWeb @ Apereo 19btopro
 
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...shesmer
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeededm00se
 
OnCrawl ElasticSearch Meetup France #12
OnCrawl ElasticSearch Meetup France #12OnCrawl ElasticSearch Meetup France #12
OnCrawl ElasticSearch Meetup France #12Cogniteev
 
Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12Tanguy MOAL
 
CUST-3 Document Management with Share
CUST-3 Document Management with ShareCUST-3 Document Management with Share
CUST-3 Document Management with ShareAlfresco Software
 
Ez platform meetup, madrid 21 marzo 2018 english
Ez platform meetup, madrid 21 marzo 2018   englishEz platform meetup, madrid 21 marzo 2018   english
Ez platform meetup, madrid 21 marzo 2018 englishcrevillo
 
Client Building Functional webapps.
Client   Building Functional webapps.Client   Building Functional webapps.
Client Building Functional webapps.Arun Kumar
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization modelEuropean Collaboration Summit
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bagstuplum
 

Similar to Présentation du générateur de site statique eleventy (20)

Contentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshopContentful with Netgen Layouts workshop
Contentful with Netgen Layouts workshop
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
 
symfony_from_scratch
symfony_from_scratchsymfony_from_scratch
symfony_from_scratch
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
HAXTheWeb @ Apereo 19
HAXTheWeb @ Apereo 19HAXTheWeb @ Apereo 19
HAXTheWeb @ Apereo 19
 
Static website generators
Static website generatorsStatic website generators
Static website generators
 
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Html5
Html5Html5
Html5
 
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
AD113  Speed Up Your Applications w/ Nginx and PageSpeedAD113  Speed Up Your Applications w/ Nginx and PageSpeed
AD113 Speed Up Your Applications w/ Nginx and PageSpeed
 
OnCrawl ElasticSearch Meetup France #12
OnCrawl ElasticSearch Meetup France #12OnCrawl ElasticSearch Meetup France #12
OnCrawl ElasticSearch Meetup France #12
 
Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12
 
CUST-3 Document Management with Share
CUST-3 Document Management with ShareCUST-3 Document Management with Share
CUST-3 Document Management with Share
 
Ez platform meetup, madrid 21 marzo 2018 english
Ez platform meetup, madrid 21 marzo 2018   englishEz platform meetup, madrid 21 marzo 2018   english
Ez platform meetup, madrid 21 marzo 2018 english
 
Yoav Kutner Dutchento
Yoav Kutner DutchentoYoav Kutner Dutchento
Yoav Kutner Dutchento
 
Html5 basics
Html5 basicsHtml5 basics
Html5 basics
 
Client Building Functional webapps.
Client   Building Functional webapps.Client   Building Functional webapps.
Client Building Functional webapps.
 
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 

Recently uploaded

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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)
 
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
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Présentation du générateur de site statique eleventy

  • 1. Eleventy aka 11ty webmardi.ch 6 juillet 2021 By Gilles Vauvarin
  • 2. ● Blog : pixenjoy.com ● Twitter : @pixenjoy ● Side project : thewhale.cc ● Twitter : @thewhalecc ● Mastodon : thewhalecc@framapiaf.org ● Side project : k-review.com ● Stack : - HTML, CSS (TailwindCSS) - JS (Svelte, AlpineJS) - NodeJS (AdonisJS) - CMS (Kirby) - JAMstack (11ty) Hey ! Gilles Vauvarin Web developer
  • 3. Evolution of web architectures ... Dynamic monolithic sites CGI, PHP, CMS, BDD, Back Frameworks ... 1993 1989 2005 HTML pages Birth of the web, hypertextes links SPA, JAMstack ... SPA, Headless CMS, API, SSG, Front Frameworks, PWA ...
  • 4. 1996: HTML pages Request: “http://site.com/page.html” Response: <html><body> ... SERVER BROWSER page.html page1.html page2.html page3.html page4.html ...
  • 5. 1989: Dynamic monolithic sites Request: “http://site.com/page” Response: <html><body> ... SERVER BROWSER Template page.php PHP BDD Query SQL
  • 6. 2005: JAMstack > SSG > build step SSG Ex: Eleventy Template : page.njk Data : Markdown, JSON, BDD (API) page1.html page2.html page3.html page4.html ... Build on server +
  • 7. 2005: JAMstack > CDN > disponibility Request: “http://site.com/page.html” Response: <html><body> ... CDN SERVER BROWSER page1.html page2.html page3.html page4.html ...
  • 8. Eleventy Static web sites JAMstack JS - API - Markup SSG Static Site Generator
  • 9. Why are we interested in static sites? Eco-design (consumes less server resources) Security (no server-side, no DB) Cost reduction (Hosting, maintenance) Performance (if well implemented!, CDN)
  • 10. Eleventy’s author Web Developer for Netlify Zach Leatherman https://github.com/11ty/eleventy
  • 11. Eleventy’s characteristics NodeJS, packages npm Not a framework But an HTML generator Flexible Templates, Folders, Data JavaScript 01 02 03
  • 12. Some key concepts of Eleventy 01 Front matter 02 Template 03 Layout 04 Collection 05 Files architecture 06 Data cascade 07 Plugin & Filter 08 Data 09 Installation & deployment
  • 14. Front Matter quesako ? - Instruction block composed of key/value and located in the header of templates. - Allows you to indicate instructions to Eleventy and to pass data to the templates. - Written in JSON, JavaScript or YAML. You can even add your own format!
  • 16.
  • 18. Template quesako ? - Templates are content files formatted via a tag system (HTML, Markdown) or a more advanced templating language (Handlebars, Mustache, Liquid, Nunjucks ...). Eleventy support 11 templating language ! - These templates indicate how the content and data should be used in the pages that will be built by Eleventy.
  • 20. What we can do with Nunjucks? It’s like HTML with super power !
  • 21.
  • 22.
  • 23.
  • 24.
  • 26. Layout quesako ? - Layouts are special templates for wrapping content in other content. It’s quite similar to <slot> if you use a JS framework like React, Vue, Svelte ... - Their use is optional, as templating languages like Nunjuncks have similar functions.
  • 31. Collection quesako ? - A collection allows you to group content. - Use the keyword “tags” in the frontmatter to attach a content in a collection. - We can loop through a collection to display all their items. - You can attach a content to several collection.
  • 34. 05 Folders & Files How is the file system organized in Eleventy?
  • 35. Folders & Files By default all files in the root project folder will be compiled into the _site directory. root_project_folder ├── assets ├── file.md ├── file.njk └── _site Use an .eleventyignore file to let eleventy know which files you do not want to compile.
  • 36. Folders & Files To copy your assets in the final static website, use addPassthroughCopy root_project_folder / .eleventy.js
  • 37. Folders & Files root_project_folder / .eleventy.js Custom files system:
  • 38. 06 Data Cascade Read the data in a certain order
  • 39. Data cascade quesako ? - The data, depending on their origin, are read in a certain order and with a certain priority. We distinguish : - Global data - Data files that apply to a folder - Data files that apply to a template - The frontmatter data of a layout - The frontmatter data of a template - Computed data https://benmyers.dev/blog/eleventy-data-cascade/
  • 40. 07 Plugin & Filters Extend functionality and apply filters to content
  • 41. Plugins - They allow to extend the functionalities of 11ty - Step 1: install the plugin in your 11ty project via npm - Step 2: call the plugin in your 11ty config file (.eleventy.js) - Do something at the built step - Examples: > generate a RSS feed > manage images optimization > manage syntax highlighting ...
  • 42. Plugins - Step 1: in a terminal - Step 2 : in your config file .eleventy.js
  • 43. Filters - They allow to modify a content - Template language comes with built in filters - Custom filter > definition of a "filterName" function in the .eleventy.js file - Used in a template like this : {{ myContent | filterName }}
  • 47. From files or an API - Eleventy can work with data coming from different sources : > Local files (md, html, templates …) > Local data (frontmatter, global data …) > External source (external API, Headless CMS API)
  • 48. Data from an external API my-root-project/input/ _data/about.js
  • 49. Data from an external API my-root-project/input/ about/about.njk
  • 50. 09 Installation & Deployment How to install & deploy Eleventy?
  • 51. Installation NodeJS (v.10 min) and npm are required
  • 53. Installation How to run eleventy now ?
  • 54. Deployment Static files are easy to deploy ... Vercel Netlify Cloudflare pages
  • 55. Deployment - Version your project in a Git repository (Github, Gitlab, Bitbucket …). - Choose a hosting company (Netlify, Vercel …). - Link Netlify or whatever to your Git repository (dashboard). - Allow Netlify or whatever and your Git platform to talk to each other (Git platform SSH). - Select your static site from your Git platform (dashboard). - Configure your settings: branch, publish directory (dashboard). - Use a build hook to watch your update on your Git repository and trigger an automatic deployment.
  • 56. Static sites ... for which type of projects? - Content Website (up to a certain size) - Website with few daily update Corporate website, documentation, blog, landing page, portfolio, agency website ... and many more. > 80% of Web ?
  • 57. Eleventy - Pretty fast build times. - Zero-config by default but has flexible configuration options. - Works with your project’s existing directory structure. - Node/javaScript ecosystem. - Output pur HTML/CSS. - Works with multiple template languages. - Great use of data files/sources. - OpenSource. Con Pro - Sparse documentation. - Limited tooling, community, tutorials. - Not for very big website (build time, deployment) - Do not manage dynamic part. - You have to know how to write code to publish content by default (Markdown).
  • 58. Mixing static and dynamic Meta frameworks Next, Nuxt, Sveltekit, Astro ... Headless CMS Strapi, WP, Kirby, Forestry ... Serverless functions Netlify, Vercel, Cloudflare ...
  • 59. Questions ? ● Blog : pixenjoy.com ● Twitter : @pixenjoy ● Side project : thewhale.cc ● Twitter : @thewhalecc ● Mastodon : thewhalecc@framapiaf.org ● Side project : k-review.com Gilles Vauvarin
  • 60. CREDITS: This presentation template was created by Slidesgo, including icons by Flaticon, and infographics & images by Freepik THANKS