# crabston/grav-theme-hadron architecture

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

- Interactive diagram: https://gitdiagram.com/crabston/grav-theme-hadron
- Repository: https://github.com/crabston/grav-theme-hadron

## Overview

Hadron is a Grav theme for building customizable sites. The principal workflow is configuring theme options and authoring page content, which Grav presents through Hadron’s page templates and shared site chrome. Distinct content capabilities include blog, documentation, modular pages, H5P, and Embed.ly; browser-side behavior adds responsive tables and navigation interactions. The README documents the major features, while sampled PHP and JavaScript show shortcode registration/rendering and client behavior. Template-to-blueprint routing is not shown, so those links are omitted.

Main entry points: [`templates`](https://github.com/crabston/grav-theme-hadron/tree/main/templates) (Page templates), [`hadron.php`](https://github.com/crabston/grav-theme-hadron/blob/main/hadron.php) (Shortcode registration), [`js/hadron.js`](https://github.com/crabston/grav-theme-hadron/blob/main/js/hadron.js) (Theme interactions), [`shortcodes/H5PShortcode.php`](https://github.com/crabston/grav-theme-hadron/blob/main/shortcodes/H5PShortcode.php) (H5P embeds)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Site authoring"]
  node_theme_options["Theme options<br/>[hadron.yaml]"]
  node_page_blueprints["Page blueprints"]
end

subgraph group_rendering["Page rendering"]
  node_templates["Page templates"]
  node_shared_layout["Shared layout"]
  node_blog_pages["Blog pages<br/>[blog.html.twig]"]
  node_docs_pages["Docs pages<br/>[docs.html.twig]"]
  node_modular_pages["Modular pages"]
  node_navigation["Navigation and language"]
end

subgraph group_integrations["Content integrations"]
  node_shortcode_setup["Shortcode registration<br/>[hadron.php]"]
  node_h5p_shortcode["H5P embeds<br/>[H5PShortcode.php]"]
  node_embedly_shortcode["Embed.ly cards"]
end

subgraph group_browser["Browser experience"]
  node_browser_scripts["Theme interactions<br/>[hadron.js]"]
  node_responsive_tables["Responsive tables<br/>[responsiveTable.ts]"]
end

node_site_author(("Site author"))
node_grav["Grav runtime"]
node_h5p_service["H5P content service"]
node_embedly_service["Embed.ly service"]

node_site_author -->|"configures"| node_theme_options
node_site_author -->|"authors pages"| node_page_blueprints
node_grav -->|"uses theme"| node_templates
node_templates -.->|"renders shared chrome"| node_shared_layout
node_templates -.->|"renders blog"| node_blog_pages
node_templates -.->|"renders docs"| node_docs_pages
node_templates -.->|"renders modular content"| node_modular_pages
node_templates -.->|"renders navigation"| node_navigation
node_grav -->|"registers handlers"| node_shortcode_setup
node_shortcode_setup -->|"loads shortcode"| node_h5p_shortcode
node_shortcode_setup -->|"loads shortcode"| node_embedly_shortcode
node_h5p_shortcode -->|"embeds content"| node_h5p_service
node_embedly_shortcode -->|"loads card widget"| node_embedly_service
node_browser_scripts -->|"creates card links"| node_embedly_service
node_browser_scripts -.->|"initializes tables"| node_responsive_tables

click node_theme_options "https://github.com/crabston/grav-theme-hadron/blob/main/hadron.yaml"
click node_page_blueprints "https://github.com/crabston/grav-theme-hadron/tree/main/blueprints"
click node_templates "https://github.com/crabston/grav-theme-hadron/tree/main/templates"
click node_shared_layout "https://github.com/crabston/grav-theme-hadron/tree/main/templates/partials"
click node_blog_pages "https://github.com/crabston/grav-theme-hadron/blob/main/templates/blog.html.twig"
click node_docs_pages "https://github.com/crabston/grav-theme-hadron/blob/main/templates/docs.html.twig"
click node_modular_pages "https://github.com/crabston/grav-theme-hadron/tree/main/templates/modular"
click node_navigation "https://github.com/crabston/grav-theme-hadron/blob/main/templates/partials/navigation.html.twig"
click node_shortcode_setup "https://github.com/crabston/grav-theme-hadron/blob/main/hadron.php"
click node_h5p_shortcode "https://github.com/crabston/grav-theme-hadron/blob/main/shortcodes/H5PShortcode.php"
click node_embedly_shortcode "https://github.com/crabston/grav-theme-hadron/blob/main/shortcodes/EmbedlyShortcode.php"
click node_browser_scripts "https://github.com/crabston/grav-theme-hadron/blob/main/js/hadron.js"
click node_responsive_tables "https://github.com/crabston/grav-theme-hadron/blob/main/ts/responsiveTable.ts"

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_theme_options,node_page_blueprints toneBlue
class node_templates,node_shared_layout,node_blog_pages,node_docs_pages,node_modular_pages,node_navigation toneAmber
class node_shortcode_setup,node_h5p_shortcode,node_embedly_shortcode toneMint
class node_browser_scripts,node_responsive_tables toneRose
class node_site_author,node_grav,node_h5p_service,node_embedly_service toneIndigo
```

## Components

### Site authoring

- [Theme options](https://github.com/crabston/grav-theme-hadron/blob/main/hadron.yaml): `hadron.yaml`
- [Page blueprints](https://github.com/crabston/grav-theme-hadron/tree/main/blueprints): `blueprints`

### Page rendering

- [Page templates](https://github.com/crabston/grav-theme-hadron/tree/main/templates): `templates`
- [Shared layout](https://github.com/crabston/grav-theme-hadron/tree/main/templates/partials): `templates/partials`
- [Blog pages](https://github.com/crabston/grav-theme-hadron/blob/main/templates/blog.html.twig): `templates/blog.html.twig`
- [Docs pages](https://github.com/crabston/grav-theme-hadron/blob/main/templates/docs.html.twig): `templates/docs.html.twig`
- [Modular pages](https://github.com/crabston/grav-theme-hadron/tree/main/templates/modular): `templates/modular`
- [Navigation and language](https://github.com/crabston/grav-theme-hadron/blob/main/templates/partials/navigation.html.twig): `templates/partials/navigation.html.twig`

### Content integrations

- [Shortcode registration](https://github.com/crabston/grav-theme-hadron/blob/main/hadron.php): `hadron.php`
- [H5P embeds](https://github.com/crabston/grav-theme-hadron/blob/main/shortcodes/H5PShortcode.php): `shortcodes/H5PShortcode.php`
- [Embed.ly cards](https://github.com/crabston/grav-theme-hadron/blob/main/shortcodes/EmbedlyShortcode.php): `shortcodes/EmbedlyShortcode.php`

### Browser experience

- [Theme interactions](https://github.com/crabston/grav-theme-hadron/blob/main/js/hadron.js): `js/hadron.js`
- [Responsive tables](https://github.com/crabston/grav-theme-hadron/blob/main/ts/responsiveTable.ts): `ts/responsiveTable.ts`

### Other components

- **Site author**
- **Grav runtime**
- **H5P content service**
- **Embed.ly service**

## Connections

- Site author → Theme options: configures (evidence: `README.md`)
- Site author → Page blueprints: authors pages (evidence: `README.md`)
- Grav runtime → Page templates: uses theme (evidence: `README.md`)
- Page templates → Shared layout: renders shared chrome
- Page templates → Blog pages: renders blog
- Page templates → Docs pages: renders docs
- Page templates → Modular pages: renders modular content
- Page templates → Navigation and language: renders navigation
- Grav runtime → Shortcode registration: registers handlers (evidence: `hadron.php`)
- Shortcode registration → H5P embeds: loads shortcode (evidence: `hadron.php`)
- Shortcode registration → Embed.ly cards: loads shortcode (evidence: `hadron.php`)
- H5P embeds → H5P content service: embeds content (evidence: `shortcodes/H5PShortcode.php`)
- Embed.ly cards → Embed.ly service: loads card widget (evidence: `shortcodes/EmbedlyShortcode.php`)
- Theme interactions → Embed.ly service: creates card links (evidence: `js/hadron.js`)
- Theme interactions → Responsive tables: initializes tables
