www.11ty.dev Open in urlscan Pro
3.121.122.184  Public Scan

URL: https://www.11ty.dev/docs/data-preprocessing/
Submission: On October 08 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

Asian Americans Advancing Justice — Stand Against Hatred
Eleventy

Eleventy Documentation
 * Docs
 * Get Started
 * ★ 15.1k
 * Search
 * Blog
 * Community
 * Firehose
 * 
 * GitHub
 * Mastodon
 * YouTube
 * Discord

Menu
 * Why Eleventy?
   * Glossary
   * Testimonials
   * Performance
 * Getting Started
   * Command Line Usage
   * Tutorials
     * Quick Tips
   * Starter Projects
   * Deployment
   * Debug Mode
   * Programmatic API
 * Community
   * Code of Conduct
   * Open Collective
   * Blog
   * Authors
   * Leaderboards
     * Add your site
 * Working with Templates
   * Add CSS, JS, Fonts
   * Layouts
     * Layout Chaining
   * Collections
   * Create Pages From Data
   * Pagination
     * Pagination Navigation
   * Content Dates
   * Permalinks
   * Internationalization (i18n)
   * Common Pitfalls
 * Using Data
   * Configure your Templates
   * Eleventy Supplied Data
   * Data Cascade
     * Front Matter Data
       * Custom Front Matter
     * Template & Directory Data Files
     * Global Data Files
       * Data Preprocessing
     * Data Deep Merge
     * Config Global Data
     * Computed Data
   * Environment Variables
   * JavaScript Data Files
   * Custom Data File Formats
 * Configuration
   * Passthrough File Copy
   * Ignore Files
   * Filters
     * url
     * slugify
     * log
     * get*CollectionItem
   * Shortcodes
   * Custom Tags
   * Events
   * Watch and Serve
     * Eleventy Dev Server
     * Browsersync
     * Vite
 * Template Languages
   * HTML
   * Markdown
   * WebC
   * JavaScript
   * Nunjucks
   * Liquid
   * Handlebars
   * Mustache
   * EJS
   * HAML
   * Pug
   * Custom
 * Plugins
   * Edge
   * Serverless
   * Image
   * Fetch
   * Partial Hydration <is-land>
   * Render
   * Internationalization (i18n)
   * RSS
   * Syntax Highlighting
   * Navigation
   * HTML <base>
   * Directory Output
   * Inclusive Language
 * API Services
   * OpenGraph Image
   * IndieWeb Avatar
   * Screenshots
   * Sparklines
 * Release History
 * Advanced

Compare npm install
Eleventy 5.81s
Remix 40.14s


BREADCRUMBS:

 * Using Data
 * Data Cascade
 * Global Data Files


GLOBAL DATA FILE PREPROCESSING

ERROR:
Feature Removal: This feature was removed in Eleventy 2.0. You can use
JavaScript Data Files or Computed Data instead.

The dir.data global data files run through this template engine before
transforming to JSON. Read more about Global Data Files.

Data Template Engine Object Key dataTemplateEngine Default "liquid" (before 1.0)
Default false (1.0 and above) Valid Options A valid template engine short name
or false Command Line Override None

Global JSON data files (not template/directory data files) can be optionally
preprocessed with a template engine specified under the dataTemplateEngine
configuration option.


EXAMPLE JUMP TO HEADING #

Filename .eleventy.js

module.exports = function(eleventyConfig) {
  return {
    "dataTemplateEngine": "njk"
  }
};

For example, if your dataTemplateEngine is using njk or liquid you can do this
in any *.json files in your _data folder:

Filename _data/myfile.json

{
  "version": "{{ pkg.version }}"
}

package.json data is available here supplied by Eleventy in the pkg variable.


OFFICIAL CMS PARTNER

CloudCannon


GOLD SPONSORS

Nordhealth
Transloadit


SUPPORTERS

★ 15.1k Star Eleventy on GitHub! This is an easy way to support our underrated
project and help boost our rank on both GitHub and jamstack.org’s list of site
generators.
 * Edit this page
 * Blog
 * Accessibility
 * 
 * Contributor Account
 * Netlify

 * Style Guide
 * Credits
 * 15.1k Stars
 * 2.79M Downloads (Last Year)
 * 296 Backers