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 & js

Component Inventory

ComponentLocationResponsibility
Markdown Files/site/content/Documentation source
Front MatterEach .md filePage metadata (title, weight)
Mermaid DiagramsInline code blocksVisual 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 EngineBuild timeStatic site generator
Site Config/site/hugo.tomlGlobal settings

Checklist for Component Diagrams

  • Scope limited to one container
  • Components represent logical groupings
  • Responsibilities clearly described
  • Dependencies and data flow shown