Skip to content

Git 图表

使用 https://gitdiagram.com/rootsongjc/website 生成的 Git 结构图,展示了项目的内容层、主题层、资产管道、构建工具、CI/CD 流程等。

若是私有仓库需要使用 GitHub Token。

架构图

flowchart TD
    %% Developer
    Dev["Developer"]:::dev

    %% Content Layer (Green)
    subgraph "Content Layer"
        direction TB
        C1["content/en"]:::content
        C2["content/zh"]:::content
        C3["data/"]:::content
        C4["archetypes/"]:::content
    end

    %% Theme & Layout Layer (Blue)
    subgraph "Theme & Layout Layer"
        direction TB
        T1[".gitmodules"]:::theme
        T2["layouts/"]:::theme
        T3["layouts/shortcodes/"]:::theme
        T4["i18n/en.yaml"]:::theme
        T5["i18n/zh.yaml"]:::theme
    end

    %% Asset Pipeline (Purple)
    subgraph "Asset Pipeline"
        direction TB
        A1["assets/scss/"]:::assets
        A2["assets/js/"]:::assets
        A3["assets/plugins/"]:::assets
        A4["static/plugins/"]:::assets
        A5["postcss.config.js"]:::assets
        A6["package.json"]:::assets
    end

    %% Build & Tooling (Orange)
    subgraph "Build & Tooling"
        direction TB
        B1["scripts/"]:::build
        B2["scripts/open_file_server.py"]:::build
        B3["start_server.sh"]:::build
        B4["build.js"]:::build
        B5["config/"]:::build
        HUGO["Hugo CLI"]:::build
        NODE["Node.js Build"]:::build
    end

    %% Static Output (Cylinder)
    Public["/public (Static Output)"]:::output

    %% CI/CD & Deployment (Red)
    subgraph "CI/CD & Deployment"
        direction TB
        CI[".github/workflows/deploy.yml"]:::ci
        META[".github/ISSUE_TEMPLATE/"]:::ci
        GHA["GitHub Actions"]:::ci
        HOST["Hosting (Cloudflare Pages)"]:::ci
    end

    %% Relationships
    Dev -->|edits| C1
    Dev -->|edits| C2
    Dev -->|edits| C3
    Dev -->|edits| C4
    Dev -->|edits| T2
    Dev -->|edits| T3
    Dev -->|edits| A1
    Dev -->|edits| A2

    A1 -->|compiled via PostCSS/SVGO| NODE
    A2 -->|bundled| NODE
    A3 -->|used by build| NODE
    A4 -->|runtime| Public
    NODE --> HUGO

    C1 --> HUGO
    C2 --> HUGO
    C3 --> HUGO
    C4 --> HUGO
    T1 --> HUGO
    T2 --> HUGO
    T3 --> HUGO
    T4 --> HUGO
    T5 --> HUGO
    B1 --> HUGO
    B4 --> HUGO
    B5 --> HUGO

    HUGO -->|generates| Public

    Public -->|deploys via| GHA
    CI --> GHA
    GHA --> HOST

    ATCLI -->|reads| C1
    ATCLI -->|reads| C2
    ATCLI -->|reads| C3
    ATCLI -->|outputs| RPT
    ATCLI --> ATO1
    ATCLI --> ATO2
    ATCLI --> ATO3

    %% Click Events
    click C1 "https://github.com/rootsongjc/website/tree/master/content/en"
    click C2 "https://github.com/rootsongjc/website/tree/master/content/zh"
    click C3 "https://github.com/rootsongjc/website/tree/master/data/"
    click C4 "https://github.com/rootsongjc/website/tree/master/archetypes/"
    click T1 "https://github.com/rootsongjc/website/blob/master/.gitmodules"
    click T2 "https://github.com/rootsongjc/website/tree/master/layouts/"
    click T3 "https://github.com/rootsongjc/website/tree/master/layouts/shortcodes/"
    click T4 "https://github.com/rootsongjc/website/blob/master/i18n/en.yaml"
    click T5 "https://github.com/rootsongjc/website/blob/master/i18n/zh.yaml"
    click A1 "https://github.com/rootsongjc/website/tree/master/assets/scss/"
    click A2 "https://github.com/rootsongjc/website/tree/master/assets/js/"
    click A3 "https://github.com/rootsongjc/website/tree/master/assets/plugins/"
    click A4 "https://github.com/rootsongjc/website/tree/master/static/plugins/"
    click A5 "https://github.com/rootsongjc/website/blob/master/postcss.config.js"
    click A6 "https://github.com/rootsongjc/website/blob/master/package.json"
    click B1 "https://github.com/rootsongjc/website/tree/master/scripts/"
    click B2 "https://github.com/rootsongjc/website/blob/master/scripts/open_file_server.py"
    click B3 "https://github.com/rootsongjc/website/blob/master/start_server.sh"
    click B4 "https://github.com/rootsongjc/website/blob/master/build.js"
    click B5 "https://github.com/rootsongjc/website/tree/master/config/"
    click AT "https://github.com/rootsongjc/website/tree/master/analysis-tool/"
    click ATO1 "https://github.com/rootsongjc/website/blob/master/analysis-tool/analyze_blog_frequency.py"
    click ATO2 "https://github.com/rootsongjc/website/blob/master/analysis-tool/print_blog_summary.py"
    click ATO3 "https://github.com/rootsongjc/website/blob/master/analysis-tool/run.sh"
    click CI "https://github.com/rootsongjc/website/blob/master/.github/workflows/deploy.yml"
    click META "https://github.com/rootsongjc/website/tree/master/.github/ISSUE_TEMPLATE/"

    %% Styles
    classDef dev fill:#fff4db,stroke:#f5a623,color:#000;
    classDef content fill:#e6ffed,stroke:#2ca02c,color:#000;
    classDef theme fill:#e7f1ff,stroke:#1f77b4,color:#000;
    classDef assets fill:#f5e6ff,stroke:#9467bd,color:#000;
    classDef build fill:#fff1e6,stroke:#ff7f0e,color:#000;
    classDef ci fill:#ffe6e6,stroke:#d62728,color:#000;
    classDef analysis fill:#f2f2f2,stroke:#7f7f7f,color:#000;
    classDef output fill:#ffffff,stroke:#17becf,stroke-dasharray: 5 5, color:#000;