# jaspervdj/hakyll architecture

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

- Interactive diagram: https://gitdiagram.com/jaspervdj/hakyll
- Repository: https://github.com/jaspervdj/hakyll
- Video tour (about a minute): https://gitdiagram.com/jaspervdj/hakyll/video

## Overview

Hakyll is a Haskell static-site-generator library. A typical user workflow is to define build rules for source content, compile and render pages, then write generated files; the tree also exposes preview, feeds, and other web-oriented features. The component map is based on module and directory names, not inspected implementations: no source excerpts were provided, so inferred relationships are dashed and uncited.

Main entry points: [`lib/Hakyll/Core/Compiler.hs`](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Compiler.hs) (Compiler engine), [`lib/Hakyll/Core/Rules.hs`](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Rules.hs) (Build rules), [`lib/Hakyll/Commands.hs`](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Commands.hs) (Build commands), [`lib/Hakyll/Main.hs`](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Main.hs) (Command interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Build runtime"]
  node_main["Command interface<br/>[Main.hs]"]
  node_commands["Build commands<br/>[Commands.hs]"]
  node_rules["Build rules<br/>[Rules.hs]"]
  node_provider["Source provider<br/>[Provider.hs]"]
  node_compiler["Compiler engine<br/>[Compiler.hs]"]
  node_routes["Output routes<br/>[Routes.hs]"]
  node_runtime_engine["Build execution<br/>[Runtime.hs]"]
  node_store[("Build store<br/>[Store.hs]")]
end

subgraph group_content["Content processing"]
  node_pandoc["Pandoc conversion<br/>[Pandoc.hs]"]
  node_templates["Template rendering<br/>[Template.hs]"]
  node_metadata["Metadata contexts<br/>[Context.hs]"]
end

subgraph group_web["Web features"]
  node_html["HTML processing<br/>[Html.hs]"]
  node_css["CSS compression<br/>[CompressCss.hs]"]
  node_feeds["Feed generation<br/>[Feed.hs]"]
  node_tags["Tag utilities<br/>[Tags.hs]"]
  node_pagination["Pagination<br/>[Paginate.hs]"]
end

subgraph group_preview["Preview"]
  node_preview_server["Preview server<br/>[Server.hs]"]
  node_preview_poll["Preview polling<br/>[Poll.hs]"]
end

node_user(("Site author"))

node_user -.->|"runs build"| node_main
node_main -.->|"dispatches commands"| node_commands
node_commands -.->|"uses rules"| node_rules
node_rules -.->|"selects sources"| node_provider
node_rules -.->|"assigns compilers"| node_compiler
node_rules -.->|"assigns routes"| node_routes
node_commands -.->|"starts execution"| node_runtime_engine
node_runtime_engine -.->|"uses state"| node_store
node_compiler -.->|"may convert content"| node_pandoc
node_compiler -.->|"may render templates"| node_templates
node_templates -.->|"uses contexts"| node_metadata
node_compiler -.->|"may process HTML"| node_html
node_compiler -.->|"may compress CSS"| node_css
node_compiler -.->|"may generate feeds"| node_feeds
node_compiler -.->|"may use tags"| node_tags
node_compiler -.->|"may paginate"| node_pagination
node_user -.->|"views preview"| node_preview_server
node_preview_server -.->|"may poll changes"| node_preview_poll

click node_main "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Main.hs"
click node_commands "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Commands.hs"
click node_rules "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Rules.hs"
click node_provider "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Provider.hs"
click node_compiler "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Compiler.hs"
click node_routes "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Routes.hs"
click node_runtime_engine "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Runtime.hs"
click node_store "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Store.hs"
click node_pandoc "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Pandoc.hs"
click node_templates "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Template.hs"
click node_metadata "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Template/Context.hs"
click node_html "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Html.hs"
click node_css "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/CompressCss.hs"
click node_feeds "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Feed.hs"
click node_tags "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Tags.hs"
click node_pagination "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Paginate.hs"
click node_preview_server "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Preview/Server.hs"
click node_preview_poll "https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Preview/Poll.hs"

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_main,node_commands,node_rules,node_provider,node_compiler,node_routes,node_runtime_engine,node_store toneBlue
class node_pandoc,node_templates,node_metadata toneAmber
class node_html,node_css,node_feeds,node_tags,node_pagination toneMint
class node_preview_server,node_preview_poll toneRose
class node_user toneIndigo
```

## Components

### Build runtime

- [Command interface](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Main.hs): `lib/Hakyll/Main.hs`
- [Build commands](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Commands.hs): `lib/Hakyll/Commands.hs`
- [Build rules](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Rules.hs): `lib/Hakyll/Core/Rules.hs`
- [Source provider](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Provider.hs): `lib/Hakyll/Core/Provider.hs`
- [Compiler engine](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Compiler.hs): `lib/Hakyll/Core/Compiler.hs`
- [Output routes](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Routes.hs): `lib/Hakyll/Core/Routes.hs`
- [Build execution](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Runtime.hs): `lib/Hakyll/Core/Runtime.hs`
- [Build store](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Core/Store.hs): `lib/Hakyll/Core/Store.hs`

### Content processing

- [Pandoc conversion](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Pandoc.hs): `lib/Hakyll/Web/Pandoc.hs`
- [Template rendering](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Template.hs): `lib/Hakyll/Web/Template.hs`
- [Metadata contexts](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Template/Context.hs): `lib/Hakyll/Web/Template/Context.hs`

### Web features

- [HTML processing](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Html.hs): `lib/Hakyll/Web/Html.hs`
- [CSS compression](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/CompressCss.hs): `lib/Hakyll/Web/CompressCss.hs`
- [Feed generation](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Feed.hs): `lib/Hakyll/Web/Feed.hs`
- [Tag utilities](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Tags.hs): `lib/Hakyll/Web/Tags.hs`
- [Pagination](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Web/Paginate.hs): `lib/Hakyll/Web/Paginate.hs`

### Preview

- [Preview server](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Preview/Server.hs): `lib/Hakyll/Preview/Server.hs`
- [Preview polling](https://github.com/jaspervdj/hakyll/blob/master/lib/Hakyll/Preview/Poll.hs): `lib/Hakyll/Preview/Poll.hs`

### Other components

- **Site author**

## Connections

- Site author → Command interface: runs build
- Command interface → Build commands: dispatches commands
- Build commands → Build rules: uses rules
- Build rules → Source provider: selects sources
- Build rules → Compiler engine: assigns compilers
- Build rules → Output routes: assigns routes
- Build commands → Build execution: starts execution
- Build execution → Build store: uses state
- Compiler engine → Pandoc conversion: may convert content
- Compiler engine → Template rendering: may render templates
- Template rendering → Metadata contexts: uses contexts
- Compiler engine → HTML processing: may process HTML
- Compiler engine → CSS compression: may compress CSS
- Compiler engine → Feed generation: may generate feeds
- Compiler engine → Tag utilities: may use tags
- Compiler engine → Pagination: may paginate
- Site author → Preview server: views preview
- Preview server → Preview polling: may poll changes
