这是 cmd4coder 项目的 GitHub Pages 官网源码。
docs/
├── index.html # 主页面
├── css/ # 样式文件
│ ├── reset.css # CSS 重置
│ ├── variables.css # CSS 变量
│ ├── layout.css # 布局样式
│ ├── components.css # 组件样式
│ └── responsive.css # 响应式样式
├── js/ # JavaScript 文件
│ └── main.js # 主要交互逻辑
└── assets/ # 资源文件
└── icons/
└── sprite.svg # SVG 图标集合
确保 docs/ 目录下的所有文件已提交到 main 分支:
git add docs/
git commit -m "Add GitHub Pages"
git push origin main- 打开 GitHub 仓库页面
- 点击 Settings (设置)
- 在左侧菜单中找到 Pages
- 在 Source 部分:
- Branch: 选择
main - Folder: 选择
/docs
- Branch: 选择
- 点击 Save (保存)
- GitHub 会自动构建和部署网站
- 通常需要 1-2 分钟
- 部署完成后,访问地址将显示在 Pages 设置页面
网站地址格式:
https://[用户名].github.io/cmd4coder/
例如:
https://cmd4coder.github.io/cmd4coder/
Python 3:
cd docs
python -m http.server 8000Python 2:
cd docs
python -m SimpleHTTPServer 8000然后在浏览器访问: http://localhost:8000
安装 http-server:
npm install -g http-server运行服务器:
cd docs
http-server安装 Live Server 扩展,右键点击 index.html 选择 "Open with Live Server"
需要更新的位置:
index.html- Hero Section 的版本徽章index.html- Download Section 的版本号
所有下载按钮都指向 GitHub Releases 页面,会自动显示最新版本。
如需指向特定版本,修改链接格式为:
https://github.com/cmd4coder/cmd4coder/releases/download/v1.0.0/cmd4coder-v1.0.0-linux-amd64.tar.gz- 修改
docs/index.html中的对应内容 - 如需修改样式,编辑
docs/css/下的对应文件 - 提交并推送到 main 分支
- GitHub Pages 会自动重新部署(1-2分钟)
采用极简主义黑白配色:
- 主文字:
#000000 - 次要文字:
#666666 - 背景:
#FFFFFF - 边框:
#E0E0E0 - 代码背景:
#1E1E1E
使用系统字体栈,确保跨平台一致性:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif- 移动端: < 768px
- 平板: 768px - 1024px
- 桌面: > 1024px
发布前请检查:
- 所有导航链接正常工作
- 代码复制功能正常
- 外部链接正确指向 GitHub
- 移动端显示正常
- 所有浏览器兼容(Chrome、Firefox、Safari)
- 无控制台错误
与主项目相同,采用 MIT License。