# bozkurtemre/hugo-paperthin architecture

> Architecture diagram of the GitHub repository bozkurtemre/hugo-paperthin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bozkurtemre/hugo-paperthin
- Repository: https://github.com/bozkurtemre/hugo-paperthin

## Overview

##### Main Components
a. Hugo Core (Static-Site Generator)
b. Theme Layers (Paperthin theme directories)
- Archetypes
- Layouts & Partials
- Assets (CSS/JS)
- Static Files
- Data & i18n
- theme.toml (configuration)
c. User Content (Markdown posts/pages + front matter)
d. Build Pipeline
e. Generated Output (Static HTML/CSS/JS)
f. Hosting / CDN (e.g., GitHub Pages, Netlify)
g. External Services (Google Analytics, RSS feeds, Social shares)

##### Relationships & Data Flows
- User Content + Theme (layouts, assets, etc.) → processed by Hugo Core.
- Hugo Core → Build Pipeline → Output (public folder).
- Output → Deployed to Hosting/CDN.
- Output references External Services (e.g., Google Analytics script, RSS feed endpoints).
- theme.toml dictates configuration parameters (e.g., Google Analytics ID, menu items, RSS settings).

##### Architectural Patterns / Design Principles
– Plug-in / Theme Pattern: Paperthin is a “drop-in” theme that augments Hugo’s template lookup and asset pipeline.
– Convention-over-Configuration: Default templates in `layouts/_default` are overridden by more specific layouts (e.g., `layouts/posts/single.html`).
– Separation of Concerns:
- content/ – your Markdown files live outside the theme
- theme/layouts/ – template definitions, HTML partials
- theme/assets/ – styling (CSS) & client-side behaviors (JS)
- theme/static/ – static assets (manifest, SVGs)
- theme/data/ & theme/i18n/ – site data and translations

##### Detailed Component Breakdown (
1. Inputs
- content/*.md (user content)
- theme/archetypes/default.md
2. Theme Engine (Hugo Core)
- Configuration loader (hugo.toml + theme.toml)
- Template renderer (layouts/_default, posts, tags, 404)
- Asset pipeline (assets/css/*.css, assets/js/*.js, toc.js)
- i18n & Data (i18n/, data/)
3. Outputs
- public/*.html (rendered pages)
- public/assets (combined/minified CSS & JS)
- public/static files (site.webmanifest, SVGs)
- RSS Feed (auto-generated)
4. Deployment
- GitHub Pages / Netlify / Static Server
5. Runtime Extensions
- Google Analytics snippet (in head partial)
- Social share links (partials/socials.html)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Inputs
    subgraph "User Content" 
        direction TB
        MD["content/*.md"]:::content
        Archetypes["archetypes/default.md"]:::content
    end

    %% Theme Files
    subgraph "Theme Files"
        direction TB
        Config["theme.toml"]:::theme
        subgraph "Layouts & Partials"
            direction TB
            subgraph "Layouts"
                direction TB
                Baseof["layouts/_default/baseof.html"]:::theme
                ListDef["layouts/_default/list.html"]:::theme
                SingleDef["layouts/_default/single.html"]:::theme
                RenderHeading["layouts/_default/_markup/render-heading.html"]:::theme
                NotFound["layouts/404.html"]:::theme
                Index["layouts/index.html"]:::theme
                subgraph "Posts"
                    direction TB
                    PostsList["layouts/posts/list.html"]:::theme
                    PostsSingle["layouts/posts/single.html"]:::theme
                end
                TagsList["layouts/tags/list.html"]:::theme
            end
            subgraph "Partials"
                direction TB
                Head["layouts/partials/head.html"]:::theme
                Menu["layouts/partials/menu.html"]:::theme
                Scripts["layouts/partials/scripts.html"]:::theme
                Socials["layouts/partials/socials.html"]:::theme
            end
        end
        subgraph "Assets"
            direction TB
            subgraph "CSS"
                direction TB
                CSS404["assets/css/404.css"]:::asset
                CSSMain["assets/css/main.css"]:::asset
                CSSPost["assets/css/post.css"]:::asset
                CSSPosts["assets/css/posts.css"]:::asset
                CSSTags["assets/css/tags.css"]:::asset
            end
            subgraph "JavaScript"
                direction TB
                JSMain["assets/js/main.js"]:::asset
                JSToc["assets/js/toc.js"]:::asset
            end
        end
        subgraph "Static Files"
            direction TB
            Manifest["static/site.webmanifest"]:::static
            SVGs["static/svg/"]:::static
        end
        Data["data/"]:::data
        I18n["i18n/"]:::data
    end

    %% Core and Build
    Hugo["Hugo Core"]:::hugo

    %% Output
    subgraph "Generated Output (public)" 
        direction TB
        OutHTML["public/*.html"]:::output
        OutAssets["public/assets/"]:::output
        OutStatic["public/static/"]:::output
        RSS["RSS Feed"]:::output
    end

    Hosting["Hosting / CDN"]:::hosting
    External["External Services"]:::external

    %% Flows
    MD -->|"markdown + front matter"| Hugo
    Archetypes -->|"new content template"| Hugo
    Config -->|"configuration"| Hugo
    Baseof --> Hugo
    ListDef --> Hugo
    SingleDef --> Hugo
    RenderHeading --> Hugo
    NotFound --> Hugo
    Index --> Hugo
    PostsList --> Hugo
    PostsSingle --> Hugo
    TagsList --> Hugo
    Head --> Hugo
    Menu --> Hugo
    Scripts --> Hugo
    Socials --> Hugo
    CSS404 --> Hugo
    CSSMain --> Hugo
    CSSPost --> Hugo
    CSSPosts --> Hugo
    CSSTags --> Hugo
    JSMain --> Hugo
    JSToc --> Hugo
    Manifest --> Hugo
    SVGs --> Hugo
    Data --> Hugo
    I18n --> Hugo

    Hugo -->|"renders templates & assets"| OutHTML
    Hugo --> OutAssets
    Hugo --> OutStatic
    Hugo --> RSS

    OutHTML --> Hosting
    OutAssets --> Hosting
    OutStatic --> Hosting
    RSS --> Hosting

    OutHTML -->|"includes GA snippet & social links"| External

    %% Click Events
    click Archetypes "https://github.com/bozkurtemre/hugo-paperthin/blob/master/archetypes/default.md"
    click Config "https://github.com/bozkurtemre/hugo-paperthin/blob/master/theme.toml"
    click Baseof "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/_default/baseof.html"
    click ListDef "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/_default/list.html"
    click SingleDef "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/_default/single.html"
    click RenderHeading "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/_default/_markup/render-heading.html"
    click NotFound "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/404.html"
    click Index "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/index.html"
    click PostsList "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/posts/list.html"
    click PostsSingle "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/posts/single.html"
    click TagsList "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/tags/list.html"
    click Head "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/partials/head.html"
    click Menu "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/partials/menu.html"
    click Scripts "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/partials/scripts.html"
    click Socials "https://github.com/bozkurtemre/hugo-paperthin/blob/master/layouts/partials/socials.html"
    click CSS404 "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/css/404.css"
    click CSSMain "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/css/main.css"
    click CSSPost "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/css/post.css"
    click CSSPosts "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/css/posts.css"
    click CSSTags "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/css/tags.css"
    click JSMain "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/js/main.js"
    click JSToc "https://github.com/bozkurtemre/hugo-paperthin/blob/master/assets/js/toc.js"
    click Manifest "https://github.com/bozkurtemre/hugo-paperthin/blob/master/static/site.webmanifest"
    click SVGs "https://github.com/bozkurtemre/hugo-paperthin/tree/master/static/svg/"
    click Data "https://github.com/bozkurtemre/hugo-paperthin/tree/master/data/"
    click I18n "https://github.com/bozkurtemre/hugo-paperthin/tree/master/i18n/"

    %% Styles
    classDef content fill:#FFA500,stroke:#333,stroke-width:1px
    classDef theme fill:#7FB77E,stroke:#333,stroke-width:1px
    classDef asset fill:#A0D2DB,stroke:#333,stroke-width:1px
    classDef static fill:#F6C555,stroke:#333,stroke-width:1px
    classDef data fill:#C39BD3,stroke:#333,stroke-width:1px
    classDef hugo fill:#4B8BBE,stroke:#333,stroke-width:2px
    classDef output fill:#9370DB,stroke:#333,stroke-width:1px
    classDef hosting fill:#D291BC,stroke:#333,stroke-width:1px
    classDef external stroke-dasharray: 5 5,stroke:#E74C3C,fill:none,font-style:italic,stroke-width:1px
```
