# getpelican/pelican architecture

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

- Interactive diagram: https://gitdiagram.com/getpelican/pelican
- Repository: https://github.com/getpelican/pelican

## Overview

Pelican is a Python static-site generator. A site author supplies content and settings; the CLI initializes Pelican, which discovers and parses content, builds article/page and other generator outputs, and writes a static site and feeds. The product also supports themes, plugins, caching, content import, and preview serving. The graph emphasizes those documented capabilities; some connections are documented or index-supported rather than visible in full source excerpts, so uncertain links are dashed.

Main entry points: [`pelican/__init__.py`](https://github.com/getpelican/pelican/blob/main/pelican/__init__.py) (CLI and orchestration), [`pelican/generators.py`](https://github.com/getpelican/pelican/blob/main/pelican/generators.py) (Site generators), [`pelican/writers.py`](https://github.com/getpelican/pelican/blob/main/pelican/writers.py) (HTML and feeds), [`pelican/server.py`](https://github.com/getpelican/pelican/blob/main/pelican/server.py) (Preview server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Build workflow"]
  node_cli["CLI and orchestration<br/>[__init__.py]"]
  node_settings["Settings<br/>[settings.py]"]
  node_discovery["Source discovery<br/>[generators.py]"]
  node_readers["Content readers<br/>[readers.py]"]
  node_content["Content models<br/>[contents.py]"]
  node_generators["Site generators<br/>[generators.py]"]
  node_cache[("Build cache<br/>[cache.py]")]
  node_writer["HTML and feeds<br/>[writers.py]"]
end

subgraph group_extensibility["Themes and plugins"]
  node_theme["Theme templates"]
  node_plugins["Plugin loading<br/>[_utils.py]"]
  node_signals["Plugin signals<br/>[signals.py]"]
end

subgraph group_operations["Tools and preview"]
  node_importer["Content importer<br/>[pelican_import.py]"]
  node_quickstart["Project setup"]
  node_preview["Preview server<br/>[server.py]"]
end

node_author(("Site author"))
node_site["Static site output"]
node_browser(("Site visitor"))

node_author -.->|"runs build"| node_cli
node_cli -->|"loads settings"| node_settings
node_cli -->|"orchestrates"| node_generators
node_generators -->|"discovers sources"| node_discovery
node_generators -->|"parses sources"| node_readers
node_readers -->|"creates content"| node_content
node_generators -->|"organizes content"| node_content
node_generators -->|"uses cache"| node_cache
node_generators -->|"writes outputs"| node_writer
node_writer -->|"writes site"| node_site
node_writer -->|"generates feeds"| node_site
node_settings -->|"selects theme"| node_theme
node_cli -->|"loads plugins"| node_plugins
node_plugins -.->|"uses signals"| node_signals
node_cli -->|"dispatches lifecycle"| node_signals
node_author -.->|"imports legacy content"| node_importer
node_importer -.->|"converts content"| node_site
node_author -.->|"creates project"| node_quickstart
node_cli -->|"starts preview"| node_preview
node_browser -.->|"requests pages"| node_preview
node_preview -->|"serves files"| node_site

click node_cli "https://github.com/getpelican/pelican/blob/main/pelican/__init__.py"
click node_settings "https://github.com/getpelican/pelican/blob/main/pelican/settings.py"
click node_discovery "https://github.com/getpelican/pelican/blob/main/pelican/generators.py"
click node_readers "https://github.com/getpelican/pelican/blob/main/pelican/readers.py"
click node_content "https://github.com/getpelican/pelican/blob/main/pelican/contents.py"
click node_generators "https://github.com/getpelican/pelican/blob/main/pelican/generators.py"
click node_cache "https://github.com/getpelican/pelican/blob/main/pelican/cache.py"
click node_writer "https://github.com/getpelican/pelican/blob/main/pelican/writers.py"
click node_theme "https://github.com/getpelican/pelican/tree/main/pelican/themes"
click node_plugins "https://github.com/getpelican/pelican/blob/main/pelican/plugins/_utils.py"
click node_signals "https://github.com/getpelican/pelican/blob/main/pelican/plugins/signals.py"
click node_importer "https://github.com/getpelican/pelican/blob/main/pelican/tools/pelican_import.py"
click node_quickstart "https://github.com/getpelican/pelican/blob/main/pelican/tools/pelican_quickstart.py"
click node_preview "https://github.com/getpelican/pelican/blob/main/pelican/server.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_settings,node_discovery,node_readers,node_content,node_generators,node_cache,node_writer toneBlue
class node_theme,node_plugins,node_signals toneAmber
class node_importer,node_quickstart,node_preview toneMint
class node_author,node_site,node_browser toneIndigo
```

## Components

### Build workflow

- [CLI and orchestration](https://github.com/getpelican/pelican/blob/main/pelican/__init__.py): `pelican/__init__.py`
- [Settings](https://github.com/getpelican/pelican/blob/main/pelican/settings.py): `pelican/settings.py`
- [Source discovery](https://github.com/getpelican/pelican/blob/main/pelican/generators.py): `pelican/generators.py`
- [Content readers](https://github.com/getpelican/pelican/blob/main/pelican/readers.py): `pelican/readers.py`
- [Content models](https://github.com/getpelican/pelican/blob/main/pelican/contents.py): `pelican/contents.py`
- [Site generators](https://github.com/getpelican/pelican/blob/main/pelican/generators.py): `pelican/generators.py`
- [Build cache](https://github.com/getpelican/pelican/blob/main/pelican/cache.py): `pelican/cache.py`
- [HTML and feeds](https://github.com/getpelican/pelican/blob/main/pelican/writers.py): `pelican/writers.py`

### Themes and plugins

- [Theme templates](https://github.com/getpelican/pelican/tree/main/pelican/themes): `pelican/themes`
- [Plugin loading](https://github.com/getpelican/pelican/blob/main/pelican/plugins/_utils.py): `pelican/plugins/_utils.py`
- [Plugin signals](https://github.com/getpelican/pelican/blob/main/pelican/plugins/signals.py): `pelican/plugins/signals.py`

### Tools and preview

- [Content importer](https://github.com/getpelican/pelican/blob/main/pelican/tools/pelican_import.py): `pelican/tools/pelican_import.py`
- [Project setup](https://github.com/getpelican/pelican/blob/main/pelican/tools/pelican_quickstart.py): `pelican/tools/pelican_quickstart.py`
- [Preview server](https://github.com/getpelican/pelican/blob/main/pelican/server.py): `pelican/server.py`

### Other components

- **Site author**
- **Static site output**
- **Site visitor**

## Connections

- Site author → CLI and orchestration: runs build (evidence: `README.rst`)
- CLI and orchestration → Settings: loads settings (evidence: `pelican/__init__.py`)
- CLI and orchestration → Site generators: orchestrates (evidence: `pelican/__init__.py`)
- Site generators → Source discovery: discovers sources (evidence: `pelican/generators.py`)
- Site generators → Content readers: parses sources (evidence: `pelican/generators.py`)
- Content readers → Content models: creates content (evidence: `pelican/readers.py`)
- Site generators → Content models: organizes content (evidence: `pelican/generators.py`)
- Site generators → Build cache: uses cache (evidence: `pelican/generators.py`)
- Site generators → HTML and feeds: writes outputs (evidence: `pelican/generators.py`)
- HTML and feeds → Static site output: writes site (evidence: `pelican/writers.py`)
- HTML and feeds → Static site output: generates feeds (evidence: `pelican/writers.py`)
- Settings → Theme templates: selects theme (evidence: `pelican/settings.py`)
- CLI and orchestration → Plugin loading: loads plugins (evidence: `pelican/__init__.py`)
- Plugin loading → Plugin signals: uses signals
- CLI and orchestration → Plugin signals: dispatches lifecycle (evidence: `pelican/__init__.py`)
- Site author → Content importer: imports legacy content (evidence: `README.rst`)
- Content importer → Static site output: converts content (evidence: `README.rst`)
- Site author → Project setup: creates project (evidence: `pelican/tools/pelican_quickstart.py`)
- CLI and orchestration → Preview server: starts preview (evidence: `pelican/__init__.py`)
- Site visitor → Preview server: requests pages
- Preview server → Static site output: serves files (evidence: `pelican/server.py`)
