# getzola/zola architecture

> Architecture diagram of the GitHub repository getzola/zola, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/getzola/zola
- Repository: https://github.com/getzola/zola

## Overview

##### Main Components Overview

a. Core Processing Layer:
- Content Processing (components/content)
- Template Processing (components/templates)
- Asset Processing (components/imageproc, components/sass)
- Markdown Processing (components/markdown)

b. Configuration Layer:
- Site Configuration (components/config)
- Theme Management
- Multilingual Support

c. Build System:
- File System Operations
- Build Pipeline
- Live Reload Server

##### Component Relationships

**Input Sources -> Processing Pipeline -> Output Generation**

**Where:**
- Input Sources include: Content Files, Templates, Assets, Configuration
- Processing Pipeline includes: Markdown Parser, Template Engine, Asset Processor
- Output Generation includes: HTML Files, Processed Assets, Search Index

##### Detailed Component Breakdown

a. Content Processing (Rectangle):
- Markdown Parser
- Frontmatter Parser
- Shortcode Processor
- Syntax Highlighter

b. Template System (Hexagon):
- Template Engine (Tera)
- Template Functions
- Filters
- Global Functions

c. Asset Pipeline (Oval):
- Image Processing
- SASS Compilation
- Static File Copying

d. Build System (Diamond):
- File Watcher
- Live Reload Server
- Link Checker
- Search Index Generator

Following flows:
- Content Files → Markdown Processor → HTML
- Templates → Template Engine → Final Pages
- Assets → Asset Pipeline → Processed Assets
- Configuration → All Components

- Syntax Highlighting System
- Search Functionality
- Multilingual Support
- Image Processing Pipeline
- Shortcode System

##### External Integrations

Deployment targets:
- Netlify
- Vercel
- Cloudflare Pages
- GitHub Pages

##### Development Tools

Development-related components:
- Live Reload Server
- CLI Interface
- Link Checker
- Error Handler

- The single binary nature of the application
- The clear separation between content processing and template rendering
- The asset co-location feature
- The build pipeline's efficiency
- The extensibility through themes and shortcodes

- Blue: Core Processing Components
- Green: Template System
- Orange: Asset Pipeline
- Purple: Build System
- Gray: External Services

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        A[Processing Component]
        B[/CLI Component/]
        C[(Database/Storage)]
        D{Decision Point}
        E([Asset Component])
        style A fill:#blue
        style B fill:#purple
        style C fill:#orange
        style D fill:#green
        style E fill:#gray
    end

    subgraph "CLI Layer"
        CLI[/CLI Interface/]:::cli
        Build[/Build Command/]:::cli
        Serve[/Serve Command/]:::cli
        Init[/Init Command/]:::cli
        Check[/Check Command/]:::cli
    end

    subgraph "Core Processing"
        ContentProc[Content Processing]:::core
        TemplateProc[Template Processing]:::core
        MarkdownProc[Markdown Processing]:::core
        AssetProc[Asset Processing]:::core
    end

    subgraph "Content Processing Components"
        Library[Content Library]:::content
        Page[Page Processing]:::content
        Section[Section Processing]:::content
        Taxonomy[Taxonomy Processing]:::content
    end

    subgraph "Template Components"
        Filters[Template Filters]:::template
        GlobalFns[Global Functions]:::template
        Builtins[Built-in Templates]:::template
    end

    subgraph "Asset Processing"
        ImageProc[Image Processing]:::asset
        SassProc[SASS Processing]:::asset
    end

    subgraph "Markdown Components"
        Parser[Core Parser]:::markdown
        Shortcode[Shortcode System]:::markdown
        SyntaxHL[Syntax Highlighting]:::markdown
    end

    subgraph "Configuration"
        SiteConfig[Site Config]:::config
        ThemeConfig[Theme Config]:::config
        LangConfig[Language Config]:::config
    end

    subgraph "Build System"
        BuildPipe[Build Pipeline]:::build
        LinkCheck[Link Checking]:::build
        FeedGen[Feed Generation]:::build
        SitemapGen[Sitemap Generation]:::build
    end

    subgraph "Search System"
        SearchImpl[Search Implementation]:::search
        Elastic[Elasticlunr Backend]:::search
        Fuse[Fuse Backend]:::search
    end

    CLI --> Build
    CLI --> Serve
    CLI --> Init
    CLI --> Check

    Build --> BuildPipe
    BuildPipe --> ContentProc
    BuildPipe --> TemplateProc
    BuildPipe --> AssetProc
    BuildPipe --> SearchImpl

    ContentProc --> Library
    ContentProc --> Page
    ContentProc --> Section
    ContentProc --> Taxonomy

    TemplateProc --> Filters
    TemplateProc --> GlobalFns
    TemplateProc --> Builtins

    AssetProc --> ImageProc
    AssetProc --> SassProc

    MarkdownProc --> Parser
    MarkdownProc --> Shortcode
    MarkdownProc --> SyntaxHL

    SearchImpl --> Elastic
    SearchImpl --> Fuse

    BuildPipe --> LinkCheck
    BuildPipe --> FeedGen
    BuildPipe --> SitemapGen

    SiteConfig --> BuildPipe
    ThemeConfig --> BuildPipe
    LangConfig --> BuildPipe

    classDef cli fill:#purple
    classDef core fill:#blue
    classDef content fill:#lightblue
    classDef template fill:#green
    classDef asset fill:#orange
    classDef markdown fill:#yellow
    classDef config fill:#pink
    classDef build fill:#gray
    classDef search fill:#brown

    click CLI "https://github.com/getzola/zola/tree/master/src/cmd/"
    click Build "https://github.com/getzola/zola/blob/master/src/cmd/build.rs"
    click Serve "https://github.com/getzola/zola/blob/master/src/cmd/serve.rs"
    click Init "https://github.com/getzola/zola/blob/master/src/cmd/init.rs"
    click Check "https://github.com/getzola/zola/blob/master/src/cmd/check.rs"
    click ContentProc "https://github.com/getzola/zola/tree/master/components/content/"
    click Library "https://github.com/getzola/zola/blob/master/components/content/src/library.rs"
    click Page "https://github.com/getzola/zola/blob/master/components/content/src/page.rs"
    click Section "https://github.com/getzola/zola/blob/master/components/content/src/section.rs"
    click Taxonomy "https://github.com/getzola/zola/blob/master/components/content/src/taxonomies.rs"
    click TemplateProc "https://github.com/getzola/zola/tree/master/components/templates/"
    click Filters "https://github.com/getzola/zola/blob/master/components/templates/src/filters.rs"
    click GlobalFns "https://github.com/getzola/zola/tree/master/components/templates/src/global_fns/"
    click Builtins "https://github.com/getzola/zola/tree/master/components/templates/src/builtins/"
    click ImageProc "https://github.com/getzola/zola/tree/master/components/imageproc/"
    click SassProc "https://github.com/getzola/zola/blob/master/components/site/src/sass.rs"
    click MarkdownProc "https://github.com/getzola/zola/tree/master/components/markdown/"
    click Parser "https://github.com/getzola/zola/blob/master/components/markdown/src/markdown.rs"
    click Shortcode "https://github.com/getzola/zola/tree/master/components/markdown/src/shortcode/"
    click SyntaxHL "https://github.com/getzola/zola/tree/master/components/markdown/src/codeblock/"
    click SiteConfig "https://github.com/getzola/zola/blob/master/components/config/src/config/mod.rs"
    click ThemeConfig "https://github.com/getzola/zola/blob/master/components/config/src/theme.rs"
    click LangConfig "https://github.com/getzola/zola/blob/master/components/config/src/config/languages.rs"
    click BuildPipe "https://github.com/getzola/zola/blob/master/components/site/src/lib.rs"
    click LinkCheck "https://github.com/getzola/zola/blob/master/components/site/src/link_checking.rs"
    click FeedGen "https://github.com/getzola/zola/blob/master/components/site/src/feeds.rs"
    click SitemapGen "https://github.com/getzola/zola/blob/master/components/site/src/sitemap.rs"
    click SearchImpl "https://github.com/getzola/zola/blob/master/components/search/src/lib.rs"
    click Elastic "https://github.com/getzola/zola/blob/master/components/search/src/elasticlunr.rs"
    click Fuse "https://github.com/getzola/zola/blob/master/components/search/src/fuse.rs"
```
