Level 3 β Component
C4 Level 3: Component Diagram
Purpose
The Component diagram zooms into a single container to show:
- Internal logical components/modules
- Responsibilities of each component
- Internal dependencies and data flow
Audience: Developers working on or maintaining the container.
Train.md Build Pipeline Components
For a static site like Train.md, the “container” of interest is the build pipeline:
flowchart TB
subgraph "Content Layer"
md["π Markdown Files\n(/content)"]
front["βοΈ Front Matter\n(YAML metadata)"]
diagrams["π Mermaid Diagrams\n(embedded)"]
end
subgraph "Theme Layer"
layouts["π§± Layouts\n(HTML templates)"]
partials["π§© Partials\n(reusable components)"]
shortcodes["β‘ Shortcodes\n(custom tags)"]
assets["π¨ Assets\n(SCSS, JS)"]
end
subgraph "Build Layer"
hugo["π§ Hugo Engine"]
config["π hugo.toml\n(site config)"]
end
subgraph "Output Layer"
html["π Static HTML"]
css["π¨ Compiled CSS"]
js["βοΈ JavaScript"]
end
md & front & diagrams --> hugo
layouts & partials & shortcodes & assets --> hugo
config --> hugo
hugo --> html & css & jsComponent Inventory
| Component | Location | Responsibility |
|---|---|---|
| Markdown Files | /site/content/ | Documentation source |
| Front Matter | Each .md file | Page metadata (title, weight) |
| Mermaid Diagrams | Inline code blocks | Visual documentation |
| Layouts | /themes/hugo-book/layouts/ | Page structure templates |
| Partials | /themes/hugo-book/layouts/_partials/ | Reusable HTML fragments |
| Shortcodes | /themes/hugo-book/layouts/_shortcodes/ | Custom Markdown extensions |
| Assets | /themes/hugo-book/assets/ | Styles and scripts |
| Hugo Engine | Build time | Static site generator |
| Site Config | /site/hugo.toml | Global settings |
Checklist for Component Diagrams
- Scope limited to one container
- Components represent logical groupings
- Responsibilities clearly described
- Dependencies and data flow shown