# ckckh2023/xiao-blog architecture

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

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

## Overview

Xiao-Blog is a zero-build personal technology blog deployed as static pages on Cloudflare Pages, with a small set of Pages Functions. Visitors browse the homepage, project and share catalogs, friend/about pages, and a hierarchical Markdown knowledge base; the article API supplies article content to the docs experience. The guestbook adds validated, rate-limited submissions persisted in D1. RSS and sitemap functions derive feeds and article URLs from the docs catalog and Markdown assets. Frontend wiring beyond sampled functions is inferred only where the README and tree identify the capability; uncertain calls are omitted.

Main entry points: [`assets/js/docs.js`](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/docs.js) (Docs behavior), [`index.html`](https://github.com/ckckh2023/xiao-blog/blob/main/index.html) (Homepage), [`friend/index.html`](https://github.com/ckckh2023/xiao-blog/blob/main/friend/index.html) (Friends page), [`repo/index.html`](https://github.com/ckckh2023/xiao-blog/blob/main/repo/index.html) (Project showcase)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site pages"]
  node_home["Homepage<br/>[index.html]"]
  node_homejs["Home behavior<br/>[home.js]"]
  node_friend["Friends page<br/>[index.html]"]
  node_friendlist["Friend catalog<br/>[FriendList.json]"]
  node_about["About page<br/>[index.html]"]
  node_theme["Theme setup<br/>[theme-init.js]"]
end

subgraph group_content["Content features"]
  node_repo["Project showcase<br/>[index.html]"]
  node_repojs["Project search<br/>[repo.js]"]
  node_repolist["Project catalog<br/>[RepoList.json]"]
  node_docs["Docs browser<br/>[index.html]"]
  node_articlepage["Article view<br/>[article.html]"]
  node_docsjs["Docs behavior<br/>[docs.js]"]
  node_doclist["Docs catalog<br/>[DocsList.json]"]
  node_articles["Markdown articles"]
  node_share["Share library<br/>[index.html]"]
  node_sharejs["Share behavior<br/>[share.js]"]
  node_sharedata["Share catalogs"]
  node_guestpage["Guestbook page<br/>[index.html]"]
  node_guestjs["Guestbook behavior<br/>[guestbook.js]"]
end

subgraph group_edge["Edge functions"]
  node_guestapi["Guestbook API<br/>[guestbook.js]"]
  node_articleapi["Article API<br/>[article.js]"]
  node_rss["RSS generator<br/>[rss.xml.js]"]
  node_sitemap["Sitemap generator<br/>[sitemap.xml.js]"]
end

subgraph group_state["Persistent data"]
  node_d1[("D1 messages<br/>[schema.sql]")]
end

node_visitor(("Visitor"))
node_assets["Pages assets"]
node_cloudflare["Cloudflare Pages"]

node_visitor -->|"opens"| node_home
node_visitor -->|"browses"| node_repo
node_visitor -->|"browses"| node_docs
node_visitor -->|"browses"| node_share
node_visitor -->|"visits"| node_guestpage
node_visitor -->|"visits"| node_friend
node_visitor -->|"visits"| node_about
node_home -->|"loads"| node_homejs
node_repo -->|"loads"| node_repojs
node_repojs -->|"reads"| node_repolist
node_docs -->|"loads"| node_docsjs
node_docsjs -->|"reads"| node_doclist
node_docsjs -->|"opens"| node_articlepage
node_articlepage -->|"loads"| node_docsjs
node_docsjs -->|"requests"| node_articleapi
node_articleapi -->|"fetches Markdown"| node_assets
node_share -->|"loads"| node_sharejs
node_sharejs -->|"reads"| node_sharedata
node_guestpage -->|"loads"| node_guestjs
node_guestjs -->|"requests"| node_guestapi
node_guestapi -->|"reads/writes"| node_d1
node_friend -->|"reads"| node_friendlist
node_home -->|"loads"| node_theme
node_cloudflare -->|"dispatches"| node_rss
node_cloudflare -->|"dispatches"| node_sitemap
node_rss -->|"fetches catalog/articles"| node_assets
node_sitemap -->|"checks articles"| node_assets

click node_home "https://github.com/ckckh2023/xiao-blog/blob/main/index.html"
click node_homejs "https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/home.js"
click node_repo "https://github.com/ckckh2023/xiao-blog/blob/main/repo/index.html"
click node_repojs "https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/repo.js"
click node_repolist "https://github.com/ckckh2023/xiao-blog/blob/main/repo/RepoList.json"
click node_docs "https://github.com/ckckh2023/xiao-blog/blob/main/docs/index.html"
click node_articlepage "https://github.com/ckckh2023/xiao-blog/blob/main/docs/article.html"
click node_docsjs "https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/docs.js"
click node_doclist "https://github.com/ckckh2023/xiao-blog/blob/main/docs/DocsList.json"
click node_articles "https://github.com/ckckh2023/xiao-blog/tree/main/docs"
click node_share "https://github.com/ckckh2023/xiao-blog/blob/main/share/index.html"
click node_sharejs "https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/share.js"
click node_sharedata "https://github.com/ckckh2023/xiao-blog/tree/main/share"
click node_guestpage "https://github.com/ckckh2023/xiao-blog/blob/main/guestbook/index.html"
click node_guestjs "https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/guestbook.js"
click node_guestapi "https://github.com/ckckh2023/xiao-blog/blob/main/functions/api/guestbook.js"
click node_d1 "https://github.com/ckckh2023/xiao-blog/blob/main/schema.sql"
click node_articleapi "https://github.com/ckckh2023/xiao-blog/blob/main/functions/api/article.js"
click node_rss "https://github.com/ckckh2023/xiao-blog/blob/main/functions/rss.xml.js"
click node_sitemap "https://github.com/ckckh2023/xiao-blog/blob/main/functions/sitemap.xml.js"
click node_friend "https://github.com/ckckh2023/xiao-blog/blob/main/friend/index.html"
click node_friendlist "https://github.com/ckckh2023/xiao-blog/blob/main/friend/FriendList.json"
click node_about "https://github.com/ckckh2023/xiao-blog/blob/main/about/index.html"
click node_theme "https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/theme-init.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_homejs,node_friend,node_friendlist,node_about,node_theme toneBlue
class node_repo,node_repojs,node_repolist,node_docs,node_articlepage,node_docsjs,node_doclist,node_articles,node_share,node_sharejs,node_sharedata,node_guestpage,node_guestjs toneAmber
class node_guestapi,node_articleapi,node_rss,node_sitemap toneMint
class node_d1 toneRose
class node_visitor,node_assets,node_cloudflare toneIndigo
```

## Components

### Site pages

- [Homepage](https://github.com/ckckh2023/xiao-blog/blob/main/index.html): `index.html`
- [Home behavior](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/home.js): `assets/js/home.js`
- [Friends page](https://github.com/ckckh2023/xiao-blog/blob/main/friend/index.html): `friend/index.html`
- [Friend catalog](https://github.com/ckckh2023/xiao-blog/blob/main/friend/FriendList.json): `friend/FriendList.json`
- [About page](https://github.com/ckckh2023/xiao-blog/blob/main/about/index.html): `about/index.html`
- [Theme setup](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/theme-init.js): `assets/js/theme-init.js`

### Content features

- [Project showcase](https://github.com/ckckh2023/xiao-blog/blob/main/repo/index.html): `repo/index.html`
- [Project search](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/repo.js): `assets/js/repo.js`
- [Project catalog](https://github.com/ckckh2023/xiao-blog/blob/main/repo/RepoList.json): `repo/RepoList.json`
- [Docs browser](https://github.com/ckckh2023/xiao-blog/blob/main/docs/index.html): `docs/index.html`
- [Article view](https://github.com/ckckh2023/xiao-blog/blob/main/docs/article.html): `docs/article.html`
- [Docs behavior](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/docs.js): `assets/js/docs.js`
- [Docs catalog](https://github.com/ckckh2023/xiao-blog/blob/main/docs/DocsList.json): `docs/DocsList.json`
- [Markdown articles](https://github.com/ckckh2023/xiao-blog/tree/main/docs): `docs`
- [Share library](https://github.com/ckckh2023/xiao-blog/blob/main/share/index.html): `share/index.html`
- [Share behavior](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/share.js): `assets/js/share.js`
- [Share catalogs](https://github.com/ckckh2023/xiao-blog/tree/main/share): `share`
- [Guestbook page](https://github.com/ckckh2023/xiao-blog/blob/main/guestbook/index.html): `guestbook/index.html`
- [Guestbook behavior](https://github.com/ckckh2023/xiao-blog/blob/main/assets/js/guestbook.js): `assets/js/guestbook.js`

### Edge functions

- [Guestbook API](https://github.com/ckckh2023/xiao-blog/blob/main/functions/api/guestbook.js): `functions/api/guestbook.js`
- [Article API](https://github.com/ckckh2023/xiao-blog/blob/main/functions/api/article.js): `functions/api/article.js`
- [RSS generator](https://github.com/ckckh2023/xiao-blog/blob/main/functions/rss.xml.js): `functions/rss.xml.js`
- [Sitemap generator](https://github.com/ckckh2023/xiao-blog/blob/main/functions/sitemap.xml.js): `functions/sitemap.xml.js`

### Persistent data

- [D1 messages](https://github.com/ckckh2023/xiao-blog/blob/main/schema.sql): `schema.sql`

### Other components

- **Visitor**
- **Pages assets**
- **Cloudflare Pages**

## Connections

- Visitor → Homepage: opens
- Visitor → Project showcase: browses
- Visitor → Docs browser: browses
- Visitor → Share library: browses
- Visitor → Guestbook page: visits
- Visitor → Friends page: visits
- Visitor → About page: visits
- Homepage → Home behavior: loads
- Project showcase → Project search: loads
- Project search → Project catalog: reads
- Docs browser → Docs behavior: loads
- Docs behavior → Docs catalog: reads
- Docs behavior → Article view: opens
- Article view → Docs behavior: loads
- Docs behavior → Article API: requests
- Article API → Pages assets: fetches Markdown
- Share library → Share behavior: loads
- Share behavior → Share catalogs: reads
- Guestbook page → Guestbook behavior: loads
- Guestbook behavior → Guestbook API: requests
- Guestbook API → D1 messages: reads/writes
- Friends page → Friend catalog: reads
- Homepage → Theme setup: loads
- Cloudflare Pages → RSS generator: dispatches
- Cloudflare Pages → Sitemap generator: dispatches
- RSS generator → Pages assets: fetches catalog/articles
- Sitemap generator → Pages assets: checks articles
