# donini/labrador-jekyll-theme architecture

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

- Interactive diagram: https://gitdiagram.com/donini/labrador-jekyll-theme
- Repository: https://github.com/donini/labrador-jekyll-theme

## Overview

##### Main Components
- Configuration & Data: At the core you have the _config.yml, the .htaccess file (for redirect or URL rewriting), and the _data folder containing language files (in JSON) and social links. These provide global settings and content-specific data.
- Content Sources: The markdown files (blog.md, en.md, pt.md) in the project root alongside blog post markdown files under the _posts folder serve as the sources of content. These files hold the front matter needed for Jekyll builds, like layout selections and metadata.
- Template Components: The _includes folder is split into “general” components (header, footer, menu, language switcher, social links, and blog-specific elements) and “sections” (blocks for distinct parts of the front page like profile sections). Additionally, the _layouts folder contains different HTML templates (default, blog, page, post) that determine how pages are rendered.
- Assets: The assets folder holds CSS (with SASS stylesheets, blog-specific CSS, and a normalize.css file), fonts, images, and JavaScript. These ensure the visual representation, layout styling, and interactive behavior of the generated site.
- Media: A dedicated media directory is available for storing resources, particularly for blog posts (e.g., featured images).

##### Relationships and Interactions
- The _config.yml file directs the behavior of the Jekyll build, feeding into how posts, pages, and layouts link together.
- Content files in _posts and root-level language markdown files use front matter to specify which _layout to use and reference _includes partials, allowing dynamic assembly of pages.
- The _data directory’s JSON files are consumed by the Liquid templating system within the _includes or layouts to generate multilingual content and social links.
- The _includes folder components are injected into the _layouts to create a cohesive HTML structure. These components are used to maintain consistency across the site (e.g., shared header/footer, blog sidebars).
- Assets (CSS, JS, fonts) are loaded into the final HTML outputs as referenced within layout or include files to deliver styles and functionality.
- The .htaccess file represents a deployment-level component that governs URL routing or redirection (e.g., directing traffic to the “pt” version if needed).

##### Architectural Patterns and Design Principles
- Template-Based Rendering: Jekyll’s model of splitting content into layouts, includes, and posts is an example of the templating pattern.
- Separation of Concerns: Configuration and data are isolated from presentation. Content is defined in Markdown, presentation is handled by layouts and includes, and style/branding by assets.
- Modular Design: The division into general components (global elements) and sections (specific blocks for content) makes it easier to reuse and customize pieces of the theme.
- Multi-language Support: By listing language files and instructions in the README, the project clearly separates language-specific content from processing logic.

- The separation between configuration/data and presentation.
- The modular approach to building pages via Jekyll’s templating system.
- How assets are integrated to give the final rendered output.

This approach ensures that each component’s role is clearly mapped out and the overall workflow—from source content and configuration to final static site generation—is clearly illustrated.

## Diagram (Mermaid)

```mermaid
flowchart TD

    subgraph "Configuration & Global Data"
        Config["_config.yml"]:::config
        Htaccess[".htaccess"]:::config
        Data["_data"]:::config
    end

    subgraph "Content Sources"
        RootMD["Root Markdown (blog.md, en.md, pt.md)"]:::content
        Posts["_posts Directory"]:::content
    end

    subgraph "Templates"
        Layouts["_layouts"]:::templates
        subgraph "Template Components"
            General["_includes/general"]:::templates
            Sections["_includes/sections"]:::templates
        end
    end

    subgraph "Assets & Styling"
        Assets["assets"]:::assets
    end

    subgraph "Media Resources"
        Media["media"]:::media
    end

    Config -->|"feeds"| Layouts
    Htaccess -->|"controls"| Layouts
    Data -->|"provides-data"| Layouts

    RootMD -->|"content"| Layouts
    Posts -->|"content"| Layouts
    Posts -->|"references"| Media

    Layouts -->|"includes"| General
    Layouts -->|"includes"| Sections
    Layouts -->|"loads"| Assets

    click Config "https://github.com/donini/labrador-jekyll-theme/blob/master/_config.yml"
    click Htaccess "https://github.com/donini/labrador-jekyll-theme/blob/master/.htaccess"
    click Data "https://github.com/donini/labrador-jekyll-theme/tree/master/_data"
    click RootMD "https://github.com/donini/labrador-jekyll-theme/blob/master/blog.md"
    click Posts "https://github.com/donini/labrador-jekyll-theme/tree/master/_posts"
    click General "https://github.com/donini/labrador-jekyll-theme/tree/master/_includes/general"
    click Sections "https://github.com/donini/labrador-jekyll-theme/tree/master/_includes/sections"
    click Layouts "https://github.com/donini/labrador-jekyll-theme/tree/master/_layouts"
    click Assets "https://github.com/donini/labrador-jekyll-theme/tree/master/assets"
    click Media "https://github.com/donini/labrador-jekyll-theme/tree/master/media"

    classDef config fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef content fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef templates fill:#ffe4b5,stroke:#333,stroke-width:2px;
    classDef assets fill:#ffb6c1,stroke:#333,stroke-width:2px;
    classDef media fill:#e0ffff,stroke:#333,stroke-width:2px;
```
