一个用于托管“基于代码生成课程,解读开源项目”的静态网站。
当前收录:
frontend-slides- 中文课程:
frontend-slides-course-zh/index.html - English course:
frontend-slides-course-en/index.html
- 中文课程:
在仓库根目录启动静态服务器:
python3 -m http.server 4173打开 http://localhost:4173/。首页语言可通过右上角切换,也可以直接访问 ?lang=en 或 ?lang=zh。
课程内容仍然是两个独立的静态目录。修改课程模块后,可以从仓库根目录执行:
(cd frontend-slides-course-en && bash build.sh)
(cd frontend-slides-course-zh && bash build.sh)在 portal.js 的 projects 数组添加项目元数据,并为每种语言提供一个静态课程入口:
{
name: "your-project",
repository: "https://github.com/owner/your-project",
languages: [
{ key: "en", path: "your-project-course-en/index.html" },
{ key: "zh", path: "your-project-course-zh/index.html" }
]
}这是一个无构建步骤的静态站点,Cloudflare Pages 可以直接连接 GitHub 仓库:
- Production branch:
main - Build command:留空
- Build output directory:
/(仓库根目录) - Functions:不需要
每次 push 到 main 后,Cloudflare Pages 会重新发布根目录中的门户和两个课程目录。