Files
TCP-IP-NetworkNote/site/.vitepress/chapters.mjs
riba2534 c6ddea28fe feat: 新增 VitePress 电子书网站,部署到 Cloudflare Pages
将笔记转化为精美的 VitePress 静态电子书网站:

- site/ 工程目录:构建脚本从 chXX/README.md + .c 源码 + images/ 幂等生成
  19 个章节页 + 96 个源码页(每个 .c 独立页面,Shiki 语法高亮)
- 构建脚本零依赖,处理 3 种代码链接形态(同章/跨章/绝对URL)+
  110 处图片路径转换,保持原 Markdown 结构不变
- 首页 hero 用 AI 生成的网络主题封面图,配套 favicon 多尺寸
- 中文衬线正文排版 + GitHub 风格代码主题 + 本地全文搜索
- GitHub Actions + wrangler 自动部署到 Cloudflare Pages
- 域名 tcp.riba2534.cn

原 chXX/ 目录与根 README 保持不动,网站内容每次构建从源重新生成。
2026-06-28 13:20:32 +08:00

26 lines
1.5 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 19 章数据 — config.mts 与 scripts/build.mjs 共享的单一数据源
// 新增/调整章节只改这里一处
// 用 .mjs纯 JS以便 Node 脚本和 VitePress 配置都能直接 import
export const CHAPTERS = [
{ dir: 'ch01', title: '第 1 章 理解网络编程和套接字' },
{ dir: 'ch02', title: '第 2 章 套接字类型与协议设置' },
{ dir: 'ch03', title: '第 3 章 地址族与数据序列' },
{ dir: 'ch04', title: '第 4 章 基于 TCP 的服务端/客户端1' },
{ dir: 'ch05', title: '第 5 章 基于 TCP 的服务端/客户端2' },
{ dir: 'ch06', title: '第 6 章 基于 UDP 的服务端/客户端' },
{ dir: 'ch07', title: '第 7 章 优雅地断开套接字的连接' },
{ dir: 'ch08', title: '第 8 章 域名及网络地址' },
{ dir: 'ch09', title: '第 9 章 套接字的多种可选项' },
{ dir: 'ch10', title: '第 10 章 多进程服务器端' },
{ dir: 'ch11', title: '第 11 章 进程间通信' },
{ dir: 'ch12', title: '第 12 章 I/O 复用' },
{ dir: 'ch13', title: '第 13 章 多种 I/O 函数' },
{ dir: 'ch14', title: '第 14 章 多播与广播' },
{ dir: 'ch15', title: '第 15 章 套接字和标准 I/O' },
{ dir: 'ch16', title: '第 16 章 关于 I/O 流分离的其他内容' },
{ dir: 'ch17', title: '第 17 章 优于 select 的 epoll' },
{ dir: 'ch18', title: '第 18 章 多线程服务器端的实现' },
{ dir: 'ch24', title: '第 24 章 制作 HTTP 服务器端' },
]