CARVIEW |
- Stable
3.1.2
- Canary
4.0.0-alpha.4
- Guide
Guide
- Plugins
- Services
Data Cascade
On this page
In Eleventy, data is merged from multiple different sources before the template is rendered. The data is merged in what Eleventy calls the Data Cascade.
Sources of Data
When the data is merged in the Eleventy Data Cascade, the order of priority for sources of data is (from highest priority to lowest):
- Computed Data
- Front Matter Data in a Template
- Template Data Files
- Directory Data Files (and ascending Parent Directories)
- Front Matter Data in Layouts (this moved in 1.0)
- Configuration API Global Data
- Global Data Files
Example
---
title: This is a Good Blog Post
tags:
- CSS
- HTML
layout: my-layout.njk
---
---
title: This is a Very Good Blog Post
author: Zach
tags:
- JavaScript
---
Note that when my-template.md
and my-layout.njk
share data with the same object key (title
and tags
), the “leaf template” my-template.md
takes precedence.
The data cascade results in the following data when my-template.md
is rendered:
{
"title": "This is a Good Blog Post",
"author": "Zach",
"tags": ["CSS", "HTML", "JavaScript"],
"layout": "my-layout.njk"
}
By default in v1.0, Eleventy does a deep data merge to combine Object literals and Arrays. If you want to opt-out of this behavior and revert to a simple top level merge (Object.assign
) from the different data sources, you can turn off Data Deep Merge. You can override this on a per-property basis too—read more at the Data Deep Merge documentation.
From the Community
×49 resources via 11tybundle.dev curated by Bob Monsour.
exhibitionism — tlohde (2025)
Last modified date of Eleventy posts — Josh Sherman (2025)
Data vs. Collections in Eleventy — Mark Dyck (2025)
Rendering FreeMarker and Python page templates with 11ty — Tobias Fedder (2025)
Generating content driven CSS with Eleventy — Sami (2025)
Expand to see 44 more resources.
Building a personal digital music library with Eleventy and APIs — Damian Walsh (2025)
Adding Random Content Using Eleventy — Stu Robson (2024)
Here's how this is all put together — Cory Dransfeldt (2024)
Adding Cooklang Support to Eleventy Three Ways — Robb Knight (2024)
Building a Blog with Eleventy (blind, any%) — Sebin Nyshkim (2024)
New Reading page, powered by the Airtable API — Melanie Richards (2024)
Eleventy - Add CSV data file support — Rob O'Leary (2024)
Umami API Top 10 Pages — Clayton Errington (2024)
Building pages from data in Eleventy — Cory Dransfeldt (2024)
Eleventy Navigation Set URL to First Item in Collection — John M. Wargo (2024)
Version 3 — Devin Haska (2024)
Using B2 as a JSON data store — Cory Dransfeldt (2024)
Eleventy - Differentiate between dev and production builds with unique favicons — Rob O'Leary (2024)
Community websites with Eleventy — Juha-Matti Santala (2024)
Creating an OPML File for my Blogroll — Robb Knight (2024)
Learning New Tricks — Antonio Rodrigues (2024)
Right here, right now — Martin Gunnarsson (2024)
Adding a git based changelog in 11ty — James Doc (2023)
Programmatically importing your Last.fm listening data to ListenBrainz — Cory Dransfeldt (2023)
Popular Pages with Eleventy and Fathom Analytics — Robb Knight (2023)
Scratch that...use the Google Sheets API — Bob Monsour (2023)
Build a Blogroll with Eleventy — Ben Myers (2023)
Using Eleventy filters in Directory Computed Data — Chris Coleman (2023)
Relational data in Eleventy — Dan Burzo (2022)
How to access post content in template listing files — Al Power (2022)
Testing the Netlify Cache Plugin with Eleventy — Raymond Camden (2022)
Journey to the Center of the Eleventy Data Cascade with Ben Myers — Ben Myers (2022)
11ty tips I wish I knew from the start — David East (2022)
Dynamically choosing a data file to use in Eleventy templates — Cassey Lottman (2021)
Media Diary with Eleventy — anh (2021)
A Running Log - Garmin Connect and Eleventy — Josh Crain (2021)
Building a notification thingamajig with Eleventy data — Ashur Cabrera (2021)
Stop forgetting the Eleventy Data Cascade — Kaan Divringi (2021)
Creating pages from data with Eleventy — Florian Eckerstorfer (2021)
I Finally Understand Eleventy's Data Cascade — Ben Myers (2021)
Site Metadata — Stephanie Eckles (2021)
Using Template Content as Data for 11ty — Stephanie Eckles (2021)
How to use CSV data with Eleventy — Max Kohler (2021)
Add structured data annotations to Eleventy blog — Max Ivanov (2020)
Understanding Filters, Shortcodes and Data in 11ty — Mike (2020)
Composing data in Eleventy — Ryan Boone (2020)
Using Eleventy data files for frequently used links — Dana Byerly (2020)
Architecting data in Eleventy — Sia Karamalegos (2020)
Five Critical Things To Do Before Working With 11ty — Khalid Abuhakmeh (2020)