# estraviz/blog architecture

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

- Interactive diagram: https://gitdiagram.com/estraviz/blog
- Repository: https://github.com/estraviz/blog

## Overview

##### Project type and purpose
- This is a static website and personal blog built with the Hugo static‐site generator, using Markdown content, Hugo layouts, SCSS assets, and a Cactus theme. It is deployed automatically via Netlify (and has a GitHub Actions workflow defined).

##### File structure
- Top‐level:
- content/                   ← Markdown source for pages and blog posts
- layouts/                   ← Hugo templates & shortcodes
- themes/cactus/             ← Theme files (partials, templates, assets)
- resources/_gen/            ← Auto‐generated assets (compiled SCSS→CSS)
- static/                    ← Static assets (images, fonts) copied verbatim
- config.toml                ← Site configuration (params, menu, theme)
- data/projects.json         ← Data file for use in templates
- .github/workflows/hugo.yml ← CI pipeline to build site
- netlify.toml               ← Netlify build & deploy settings
- Patterns:
- Static‐site generator pipeline
- Template‐content separation (MVC/L → V → C)
- Asset pipeline for SCSS compilation

##### README for additional insights
- Confirms use of Hugo and Netlify
- No additional architectural sections, so we infer from build files

a. Main components:
1. Developer’s local environment (writes Markdown, templates, SCSS)
2. GitHub repository (source code, config, content, CI workflow)
3. CI/CD:
- GitHub Actions (optional)
- Netlify Build (runs `hugo`)
4. Hugo engine (core static‐site generator):
- Reads config.toml
- Loads content/* and data/*
- Applies layouts from layouts/ and themes/cactus/
- Runs resource pipeline (SCSS→CSS)
- Writes final HTML/CSS/JS to public/
5. CDN / Static hosting (Netlify’s CDN)
6. End users (browsers requesting static files)
b. Relationships and interactions:
- Developer pushes to GitHub → triggers CI (GitHub Actions or Netlify)
- CI invokes Hugo build → processes content+layouts+assets → outputs public/
- Netlify publishes public/ to global CDN
- Browser requests static files from CDN → site is rendered to visitor
c. Architectural patterns / design principles:
- Static‐site generator model (write → generate → serve)
- Separation of concerns: Markdown content vs. HTML templates vs. styles
- Asset pipeline for on‐the‐fly SCSS compilation
- GitOps / CI‐driven deployment
d. Key technologies/frameworks/libraries:
- Hugo (Go-based SSG)
- Go templates + shortcodes
- SCSS → rendered via Hugo Pipes
- Netlify build/deploy
- GitHub Actions (hugo.yml workflow)
- Cactus Hugo theme

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer and Repo
    Developer["Developer Local Machine"]:::external
    subgraph "GitHub Repository"
        Content["Content Source\n(Markdown)"]:::source
        Data["Data Files\n(projects.json)"]:::source
        Config["Hugo Config\n(config.toml)"]:::source
        NetlifyCfg["Netlify Settings\n(netlify.toml)"]:::cicd
        GHActionFile["GitHub Actions Workflow\n(hugo.yml)"]:::cicd
        Layouts["Templates & Shortcodes\n(layouts/)"]:::source
        Shortcodes["Shortcodes Directory\n(layouts/shortcodes/)"]:::source
        Theme["Cactus Theme Files\n(themes/cactus/)"]:::source
        Static["Static Assets\n(static/)"]:::source
        Resources["SCSS Pipeline Output\n(resources/_gen/assets/scss/)"]:::build
        Archetype["Archetype Templates\n(archetypes/default.md)"]:::source
    end

    %% CI/CD
    subgraph "CI/CD Services"
        GHAction["GitHub Actions Workflow"]:::cicd
        NetlifyBuild["Netlify Build & Deploy"]:::cicd
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        Hugo["Hugo Engine"]:::build
        Public["Public Output (public/)"]:::build
    end

    %% Delivery
    subgraph "Delivery"
        CDN["Netlify CDN"]:::delivery
        Browser["Browser / End User"]:::external
    end

    %% Connections
    Developer -->|"push"| Content
    Developer --> Repo
    Repo -->|"trigger"| GHAction
    Repo -->|"trigger"| NetlifyBuild
    GHAction -->|"invoke Hugo"| Hugo
    NetlifyBuild -->|"invoke Hugo"| Hugo
    Hugo -->|"generate static site"| Public
    Public -->|"deploy site"| CDN
    CDN -->|"serve files"| Browser

    %% Click Events for Repo Components
    click Content "https://github.com/estraviz/blog/tree/master/content/"
    click Data "https://github.com/estraviz/blog/blob/master/data/projects.json"
    click Config "https://github.com/estraviz/blog/blob/master/config.toml"
    click NetlifyCfg "https://github.com/estraviz/blog/blob/master/netlify.toml"
    click GHActionFile "https://github.com/estraviz/blog/blob/master/.github/workflows/hugo.yml"
    click Layouts "https://github.com/estraviz/blog/tree/master/layouts/"
    click Shortcodes "https://github.com/estraviz/blog/tree/master/layouts/shortcodes/"
    click Theme "https://github.com/estraviz/blog/tree/master/themes/cactus/"
    click Static "https://github.com/estraviz/blog/tree/master/static/"
    click Resources "https://github.com/estraviz/blog/tree/master/resources/_gen/assets/scss/"
    click Archetype "https://github.com/estraviz/blog/blob/master/archetypes/default.md"

    %% Click Events for CI/CD and Others
    click GHAction "https://github.com/estraviz/blog/blob/master/.github/workflows/hugo.yml"
    click NetlifyBuild "https://github.com/estraviz/blog/blob/master/netlify.toml"

    %% Styles
    classDef source fill:#D6E9F8,stroke:#31708F
    classDef build fill:#DFF0D8,stroke:#3C763D
    classDef cicd fill:#FCF8E3,stroke:#8A6D3B
    classDef delivery fill:#F2DEDE,stroke:#A94442
    classDef external fill:#EEEEEE,stroke:#AAAAAA
```
