# 11ty/eleventy architecture

> Architecture diagram of the GitHub repository 11ty/eleventy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/11ty/eleventy
- Repository: https://github.com/11ty/eleventy

## Overview

##### Main Components

a. Core Processing Pipeline:
- Input Processing (Template Engines)
- Data Pipeline
- Template Processing
- Output Generation

b. Key Subsystems:
- Template Engine Manager
- Data Management System
- File System Operations
- Plugin System
- Watch/Serve System

##### Component Relationships

**Input Layer**
- Template Files (Multiple formats)
- Data Files
- Configuration Files

**Processing Layer**
- Template Engine Manager
- Liquid Engine
- Nunjucks Engine
- Markdown Engine
- JavaScript Engine
- Data Pipeline
- Global Data
- Template Data
- Computed Data
- Template Processing
- Layout Resolution
- Front Matter Processing
- Content Transformation

**Output Layer**
- HTML Generation
- Asset Copying
- Build Directory Management

**Support Systems (Side Connections)**
- Plugin System
- Watch/Serve System
- Event Bus

##### Key Elements to Highlight

- Configuration system (TemplateConfig.js)
- Template engines (src/Engines/*)
- Data management (src/Data/*)
- File system operations (src/Util/FileSystemManager.js)
- Event system (src/EventBus.js)
- Watch/Serve capability (src/EleventyServe.js)

##### Implementation Details

- Use standard UML notation where appropriate
- Maintain clean spacing between components
- Related components visually
- Brief descriptions for key components
- Version/date information

##### Additional Notes

- How the system handles different template languages
- Configuration points
- Plugin integration points
- Build pipeline stages
- Where caching occurs

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        TF["Template Files"]
        DF["Data Files"]
        CF["Configuration Files"]:::config
    end

    subgraph "Template Engine System"
        TEM["Template Engine Manager"]:::engine
        BTE["Base Template Engine"]:::engine
        subgraph "Template Engines"
            LE["Liquid Engine"]:::engine
            NE["Nunjucks Engine"]:::engine
            ME["Markdown Engine"]:::engine
            JE["JavaScript Engine"]:::engine
            HE["HTML Engine"]:::engine
        end
    end

    subgraph "Data Management"
        TD["Template Data"]:::data
        CD["Computed Data"]:::data
        DQ["Data Queue"]:::data
    end

    subgraph "Template Processing"
        MT["Main Template"]:::template
        TC["Template Content"]:::template
        TL["Template Layout"]:::template
        TM["Template Map"]:::template
        TCH["Template Cache"]:::template
        TCFG["Template Config"]:::template
    end

    subgraph "File System"
        FSM["File System Manager"]:::fs
        FPU["File Path Utility"]:::fs
        FSS["File System Search"]:::fs
    end

    subgraph "Plugin System"
        RP["Render Plugin"]:::plugin
        PP["Pagination Plugin"]:::plugin
        IP["I18n Plugin"]:::plugin
    end

    subgraph "Watch/Serve"
        ES["Eleventy Server"]:::serve
        EW["Eleventy Watch"]:::serve
        EWT["Watch Targets"]:::serve
    end

    subgraph "Core"
        EV["Eleventy Main"]:::core
        DC["Default Config"]:::core
        UC["User Config"]:::core
        EB["Event Bus"]:::core
        AEE["Async Event Emitter"]:::core
    end

    %% Relationships
    TF --> TEM
    DF --> TD
    CF --> TCFG

    TEM --> |manages| BTE
    BTE --> LE & NE & ME & JE & HE

    TD --> CD
    CD --> DQ

    MT --> TC
    TC --> TL
    TL --> TM
    TM --> TCH

    FSM --> FPU
    FPU --> FSS

    EV --> DC
    DC --> UC
    EB --> AEE

    %% Click events
    click TEM "https://github.com/11ty/eleventy/blob/main/src/Engines/TemplateEngineManager.js"
    click BTE "https://github.com/11ty/eleventy/blob/main/src/Engines/TemplateEngine.js"
    click LE "https://github.com/11ty/eleventy/blob/main/src/Engines/Liquid.js"
    click NE "https://github.com/11ty/eleventy/blob/main/src/Engines/Nunjucks.js"
    click ME "https://github.com/11ty/eleventy/blob/main/src/Engines/Markdown.js"
    click JE "https://github.com/11ty/eleventy/blob/main/src/Engines/JavaScript.js"
    click HE "https://github.com/11ty/eleventy/blob/main/src/Engines/Html.js"
    click TD "https://github.com/11ty/eleventy/blob/main/src/Data/TemplateData.js"
    click CD "https://github.com/11ty/eleventy/blob/main/src/Data/ComputedData.js"
    click DQ "https://github.com/11ty/eleventy/blob/main/src/Data/ComputedDataQueue.js"
    click MT "https://github.com/11ty/eleventy/blob/main/src/Template.js"
    click TC "https://github.com/11ty/eleventy/blob/main/src/TemplateContent.js"
    click TL "https://github.com/11ty/eleventy/blob/main/src/TemplateLayout.js"
    click TM "https://github.com/11ty/eleventy/blob/main/src/TemplateMap.js"
    click TCH "https://github.com/11ty/eleventy/blob/main/src/TemplateCache.js"
    click TCFG "https://github.com/11ty/eleventy/blob/main/src/TemplateConfig.js"
    click FSM "https://github.com/11ty/eleventy/blob/main/src/Util/FileSystemManager.js"
    click FPU "https://github.com/11ty/eleventy/blob/main/src/Util/FilePathUtil.js"
    click FSS "https://github.com/11ty/eleventy/blob/main/src/FileSystemSearch.js"
    click RP "https://github.com/11ty/eleventy/blob/main/src/Plugins/RenderPlugin.js"
    click PP "https://github.com/11ty/eleventy/blob/main/src/Plugins/Pagination.js"
    click IP "https://github.com/11ty/eleventy/blob/main/src/Plugins/I18nPlugin.js"
    click ES "https://github.com/11ty/eleventy/blob/main/src/EleventyServe.js"
    click EW "https://github.com/11ty/eleventy/blob/main/src/EleventyWatch.js"
    click EWT "https://github.com/11ty/eleventy/blob/main/src/EleventyWatchTargets.js"
    click EB "https://github.com/11ty/eleventy/blob/main/src/EventBus.js"
    click AEE "https://github.com/11ty/eleventy/blob/main/src/Util/AsyncEventEmitter.js"
    click EV "https://github.com/11ty/eleventy/blob/main/src/Eleventy.js"
    click DC "https://github.com/11ty/eleventy/blob/main/src/defaultConfig.js"
    click UC "https://github.com/11ty/eleventy/blob/main/src/UserConfig.js"

    %% Styles
    classDef engine fill:#f96,stroke:#333
    classDef data fill:#c9f,stroke:#333
    classDef template fill:#9cf,stroke:#333
    classDef fs fill:#9fc,stroke:#333
    classDef plugin fill:#fc9,stroke:#333
    classDef serve fill:#ccc,stroke:#333
    classDef core fill:#f9f,stroke:#333
    classDef config fill:#ff9,stroke:#333
```
