# caijimmy/hugo-theme-stack architecture

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

- Interactive diagram: https://gitdiagram.com/caijimmy/hugo-theme-stack
- Repository: https://github.com/caijimmy/hugo-theme-stack

## Overview

Hugo Theme Stack is a card-style theme for bloggers. A site author supplies Hugo content and configuration; Hugo applies the theme’s page layouts and partials to produce a rendered site, with browser-side scripts and optional integrations adding interactive features. The tree identifies major rendering, search, comments, cookie-consent, and presentation modules, but only the README and go.mod were supplied as source text; layout and runtime connections below are therefore marked unverified.

Main entry points: [`layouts/baseof.html`](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/baseof.html) (Base layout), [`layouts/list.html`](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/list.html) (List layout), [`layouts/home.html`](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/home.html) (Home layout), [`layouts/_partials/article/article.html`](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/article/article.html) (Article renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_templates["Page templates"]
  node_base["Base layout<br/>[baseof.html]"]
  node_home["Home layout<br/>[home.html]"]
  node_listing["List layout<br/>[list.html]"]
  node_single["Single layout<br/>[single.html]"]
  node_searchpage["Search page<br/>[search.html]"]
end

subgraph group_presentation["Content presentation"]
  node_article["Article renderer<br/>[article.html]"]
  node_articleparts["Article components"]
  node_articlelists["Article lists"]
  node_sidebar["Sidebar widgets"]
  node_pagination["Pagination<br/>[pagination.html]"]
  node_head["Head metadata<br/>[head.html]"]
  node_styles["Theme styling<br/>[style.scss]"]
end

subgraph group_browser["Browser features"]
  node_mainjs["Browser entry<br/>[main.ts]"]
  node_searchjs["Search behavior<br/>[search.tsx]"]
  node_gallery["Image gallery<br/>[gallery.ts]"]
end

subgraph group_integrations["Integrations"]
  node_comments["Comment providers"]
  node_cookies["Cookie consent"]
  node_analytics["Analytics consent<br/>[analytics.html]"]
end

node_author(("Site author"))
node_hugo["Hugo site"]
node_rendered["Rendered site"]
node_externalcomments["Comment services"]
node_analyticsservice["Analytics service"]

node_author -.->|"provides content"| node_hugo
node_hugo -.->|"renders with"| node_base
node_hugo -.->|"selects layout"| node_home
node_hugo -.->|"selects layout"| node_listing
node_hugo -.->|"selects layout"| node_single
node_hugo -.->|"selects layout"| node_searchpage
node_single -.->|"renders article"| node_article
node_article -.->|"uses components"| node_articleparts
node_home -.->|"shows listings"| node_articlelists
node_listing -.->|"shows listings"| node_articlelists
node_listing -.->|"uses pagination"| node_pagination
node_home -.->|"shows widgets"| node_sidebar
node_listing -.->|"shows widgets"| node_sidebar
node_base -.->|"includes metadata"| node_head
node_base -.->|"loads styling"| node_styles
node_base -.->|"loads scripts"| node_mainjs
node_mainjs -.->|"uses search"| node_searchjs
node_article -.->|"supports gallery"| node_gallery
node_articleparts -.->|"offers comments"| node_comments
node_articleparts -.->|"offers consent"| node_cookies
node_cookies -.->|"gates analytics"| node_analytics
node_comments -.->|"connects providers"| node_externalcomments
node_analytics -.->|"loads analytics"| node_analyticsservice
node_base -.->|"produces pages"| node_rendered

click node_base "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/baseof.html"
click node_home "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/home.html"
click node_listing "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/list.html"
click node_single "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/single.html"
click node_searchpage "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/page/search.html"
click node_article "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/article/article.html"
click node_articleparts "https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/article/components"
click node_articlelists "https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/article-list"
click node_sidebar "https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/widget"
click node_pagination "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/pagination.html"
click node_head "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/head/head.html"
click node_styles "https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/scss/style.scss"
click node_mainjs "https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/ts/main.ts"
click node_searchjs "https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/ts/search.tsx"
click node_gallery "https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/ts/gallery.ts"
click node_comments "https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/comments"
click node_cookies "https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/cookies"
click node_analytics "https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/cookies/analytics.html"

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_base,node_home,node_listing,node_single,node_searchpage toneBlue
class node_article,node_articleparts,node_articlelists,node_sidebar,node_pagination,node_head,node_styles toneAmber
class node_mainjs,node_searchjs,node_gallery toneMint
class node_comments,node_cookies,node_analytics toneRose
class node_author,node_hugo,node_rendered,node_externalcomments,node_analyticsservice toneIndigo
```

## Components

### Page templates

- [Base layout](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/baseof.html): `layouts/baseof.html`
- [Home layout](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/home.html): `layouts/home.html`
- [List layout](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/list.html): `layouts/list.html`
- [Single layout](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/single.html): `layouts/single.html`
- [Search page](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/page/search.html): `layouts/page/search.html`

### Content presentation

- [Article renderer](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/article/article.html): `layouts/_partials/article/article.html`
- [Article components](https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/article/components): `layouts/_partials/article/components`
- [Article lists](https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/article-list): `layouts/_partials/article-list`
- [Sidebar widgets](https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/widget): `layouts/_partials/widget`
- [Pagination](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/pagination.html): `layouts/_partials/pagination.html`
- [Head metadata](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/head/head.html): `layouts/_partials/head/head.html`
- [Theme styling](https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/scss/style.scss): `assets/scss/style.scss`

### Browser features

- [Browser entry](https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/ts/main.ts): `assets/ts/main.ts`
- [Search behavior](https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/ts/search.tsx): `assets/ts/search.tsx`
- [Image gallery](https://github.com/caijimmy/hugo-theme-stack/blob/master/assets/ts/gallery.ts): `assets/ts/gallery.ts`

### Integrations

- [Comment providers](https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/comments): `layouts/_partials/comments`
- [Cookie consent](https://github.com/caijimmy/hugo-theme-stack/tree/master/layouts/_partials/cookies): `layouts/_partials/cookies`
- [Analytics consent](https://github.com/caijimmy/hugo-theme-stack/blob/master/layouts/_partials/cookies/analytics.html): `layouts/_partials/cookies/analytics.html`

### Other components

- **Site author**
- **Hugo site**
- **Rendered site**
- **Comment services**
- **Analytics service**

## Connections

- Site author → Hugo site: provides content (evidence: `README.md`)
- Hugo site → Base layout: renders with
- Hugo site → Home layout: selects layout
- Hugo site → List layout: selects layout
- Hugo site → Single layout: selects layout
- Hugo site → Search page: selects layout
- Single layout → Article renderer: renders article
- Article renderer → Article components: uses components
- Home layout → Article lists: shows listings
- List layout → Article lists: shows listings
- List layout → Pagination: uses pagination
- Home layout → Sidebar widgets: shows widgets
- List layout → Sidebar widgets: shows widgets
- Base layout → Head metadata: includes metadata
- Base layout → Theme styling: loads styling
- Base layout → Browser entry: loads scripts
- Browser entry → Search behavior: uses search
- Article renderer → Image gallery: supports gallery
- Article components → Comment providers: offers comments
- Article components → Cookie consent: offers consent
- Cookie consent → Analytics consent: gates analytics
- Comment providers → Comment services: connects providers
- Analytics consent → Analytics service: loads analytics
- Base layout → Rendered site: produces pages
