# richzendy/jekyll-boilerplate architecture

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

- Interactive diagram: https://gitdiagram.com/richzendy/jekyll-boilerplate
- Repository: https://github.com/richzendy/jekyll-boilerplate

## Overview

##### Project type and purpose
- This is a Jekyll-based static-site starter theme, with asset pipelines driven by Grunt (Node.js) and styling via Bootstrap SCSS.
- Purpose: give developers a ready-to-go front-end theme + build process that produces optimized HTML/CSS/JS for deployment.

##### Main components
a. Source Repository (Git)
- Markdown, HTML templates (`_layouts`, `_includes`, `.html` pages)
- Data files (`_data/*.yml`)
- SCSS source (`_scss/*`)
- JavaScript source (`js/*.js`)
- Static assets (images, fonts, SVGs)
- Configuration (`_config.yml`, Gruntfile.js, package.json)
b. Build Toolchain (Grunt on Node.js)
- SASS compilation → CSS
- Autoprefixer → prefixed CSS
- JS concatenation + Uglify → bundle.js
- SVG minification + sprite generation → svg-sprite
- Watch tasks (re-run on file changes)
c. Static Site Generator (Jekyll on Ruby)
- Reads `_config.yml`, source templates, content, data
- Renders final HTML pages
- Applies layouts/includes/navigation analytics snippets
- Generates sitemap via plugin
d. Development Server
- `grunt watch` + `jekyll serve` → Live-reload at `localhost:4000`
e. Deployment Target
- GitHub Pages or any static-file host / CDN

##### Relationships & data flows
- Developer commits code → Git
- Grunt pulls SCSS/JS/SVG source → runs tasks → outputs optimized assets into project’s asset folders (e.g., `css/`, `js/`, `svg/`)
- Jekyll takes templates + data + optimized assets → generates the final `/ _site` directory (static HTML)
- Dev server serves `/ _site` to browser
- CI/CD or manual push → deploy `/ _site` to host/CDN

##### Architectural patterns & design principles
- Clear separation of concerns:
- Presentation layer (SCSS/components/layouts)
- Build layer (Grunt tasks chaining Node.js tools)
- Content generation layer (Jekyll templates + data)
- Modular SCSS architecture: bootstrap overrides, utility, layout, component folders
- Templating via Jekyll’s include/layout hierarchy
- Data-driven loops via YAML in `_data/` for galleries, nav, etc.

##### Essential details to capture
- SCSS structure: `_bootstrap.scss` import control, `components/`, `layout/`, `utils/`
- Grunt tasks sequence: sass → autoprefixer → concat → uglify → svgmin/svgstore → watch
- Jekyll’s directory roles: `_includes`, `_layouts`, `_data`, root `.html` pages
- Live-reload workflow: dual terminals for Grunt watch + Jekyll serve
- Deployment flow: build artifacts (`_site`) → push to hosting environment

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source control
    Developer["Developer"]:::external
    Git["Git Repository"]:::external

    Developer -->|commits code| Git

    subgraph "Source Repository" 
        direction TB
        layouts["_layouts/"]:::source
        includes["_includes/"]:::source
        htmlPages["Root .html Pages\n(index.html, gallery/index.html)"]:::source
        dataFiles["_data/gallery.yml"]:::source
        subgraph "SCSS Source" 
            direction TB
            scssMain["_scss/main.scss"]:::source
            scssBootstrap["_scss/_bootstrap.scss"]:::source
            scssBase["_scss/base/"]:::source
            scssBootstrapDir["_scss/bootstrap/"]:::source
            scssComponents["_scss/components/"]:::source
            scssLayout["_scss/layout/"]:::source
            scssUtils["_scss/utils/"]:::source
            scssVendor["_scss/vendor/"]:::source
        end
        subgraph "JS Source"
            direction TB
            jsBootstrap["js/bootstrap.js"]:::source
            jsCustom["js/custom.js"]:::source
            jsMagnific["js/jquery.magnific-popup.js"]:::source
            jsCarousel["js/owl.carousel.js"]:::source
        end
        subgraph "Static Assets"
            direction TB
            img["img/"]:::source
            galleryStatic["gallery/"]:::source
            fonts["fonts/bootstrap/"]:::source
            svgAssets["svg/"]:::source
        end
        subgraph "Configuration Files"
            direction TB
            configYml["_config.yml"]:::config
            gruntfile["Gruntfile.js"]:::config
            pkgJson["package.json"]:::config
        end
    end

    %% Asset Pipeline
    subgraph "Asset Pipeline (Grunt - Node.js)"
        direction TB
        grunt["Grunt Tasks"]:::build
        sass["SASS Compilation"]:::build
        autoprefixer["Autoprefixer"]:::build
        concatUglify["Concat + Uglify"]:::build
        svgTasks["SVG Minify & Sprite"]:::build
        cssOut["CSS Bundle (css/main.css)"]:::output
        jsOut["JS Bundle (js/bundle.js)"]:::output
        svgOut["SVG Sprite"]:::output

        Git -->|reads SCSS & JS| grunt
        grunt -->|grunt sass| sass
        sass --> autoprefixer
        autoprefixer --> cssOut
        grunt -->|grunt concat| concatUglify
        concatUglify --> jsOut
        grunt -->|grunt svgmin| svgTasks
        svgTasks --> svgOut
    end

    %% Jekyll Site Generation
    subgraph "Jekyll Pipeline (Ruby)"
        direction TB
        jekyll["Jekyll build"]:::build
        siteOut["_site/"]:::output

        Git -->|reads templates, data, config| jekyll
        cssOut -->|"assets"| jekyll
        jsOut -->|"assets"| jekyll
        svgOut -->|"assets"| jekyll
        jekyll --> siteOut
    end

    %% Development Server
    subgraph "Development Server"
        direction TB
        watch["grunt watch"]:::build
        serve["jekyll serve"]:::build
        live["Live-Reload (localhost:4000)"]:::external

        grunt --> watch
        jekyll --> serve
        watch --> live
        serve --> live
    end

    %% Deployment
    CDN["Static Host/CDN"]:::external
    siteOut -->|deploy _site| CDN

    %% External Registries
    npm["npm Registry"]:::external
    rubygems["RubyGems"]:::external
    pkgJson -->|npm install| npm
    configYml -->|gem install plugins| rubygems

    %% Click Events
    click layouts "https://github.com/richzendy/jekyll-boilerplate/tree/master/_layouts/"
    click includes "https://github.com/richzendy/jekyll-boilerplate/tree/master/_includes/"
    click htmlPages "https://github.com/richzendy/jekyll-boilerplate/blob/master/index.html"
    click htmlPages "https://github.com/richzendy/jekyll-boilerplate/blob/master/gallery/index.html"
    click dataFiles "https://github.com/richzendy/jekyll-boilerplate/blob/master/_data/gallery.yml"
    click scssMain "https://github.com/richzendy/jekyll-boilerplate/blob/master/_scss/main.scss"
    click scssBootstrap "https://github.com/richzendy/jekyll-boilerplate/blob/master/_scss/_bootstrap.scss"
    click scssBase "https://github.com/richzendy/jekyll-boilerplate/tree/master/_scss/base/"
    click scssBootstrapDir "https://github.com/richzendy/jekyll-boilerplate/tree/master/_scss/bootstrap/"
    click scssComponents "https://github.com/richzendy/jekyll-boilerplate/tree/master/_scss/components/"
    click scssLayout "https://github.com/richzendy/jekyll-boilerplate/tree/master/_scss/layout/"
    click scssUtils "https://github.com/richzendy/jekyll-boilerplate/tree/master/_scss/utils/"
    click scssVendor "https://github.com/richzendy/jekyll-boilerplate/tree/master/_scss/vendor/"
    click jsBootstrap "https://github.com/richzendy/jekyll-boilerplate/blob/master/js/bootstrap.js"
    click jsCustom "https://github.com/richzendy/jekyll-boilerplate/blob/master/js/custom.js"
    click jsMagnific "https://github.com/richzendy/jekyll-boilerplate/blob/master/js/jquery.magnific-popup.js"
    click jsCarousel "https://github.com/richzendy/jekyll-boilerplate/blob/master/js/owl.carousel.js"
    click img "https://github.com/richzendy/jekyll-boilerplate/tree/master/img/"
    click galleryStatic "https://github.com/richzendy/jekyll-boilerplate/tree/master/gallery/"
    click fonts "https://github.com/richzendy/jekyll-boilerplate/tree/master/fonts/bootstrap/"
    click svgAssets "https://github.com/richzendy/jekyll-boilerplate/tree/master/svg/"
    click configYml "https://github.com/richzendy/jekyll-boilerplate/blob/master/_config.yml"
    click gruntfile "https://github.com/richzendy/jekyll-boilerplate/blob/master/Gruntfile.js"
    click pkgJson "https://github.com/richzendy/jekyll-boilerplate/blob/master/package.json"

    %% Styles
    classDef source fill:#D0E8FF,stroke:#0284C7,color:#000
    classDef build fill:#E6FFE6,stroke:#2F8F2F,color:#000
    classDef output fill:#E6F7E6,stroke:#2F8F2F,color:#000
    classDef config fill:#FFF4E5,stroke:#E08E00,color:#000
    classDef external fill:#F0F0F0,stroke:#999,color:#000
```
