通过 Git + GitHub Pages 实现的在线简历,每次推送更新后自动刷新页面内容。
用浏览器直接打开 index.html,或用本地服务器:
# Python 3
python -m http.server 8000
# 然后访问 http://localhost:8000- 登录 GitHub
- 点击右上角
+→New repository - 仓库名:
resume或cv(可自定义) - 选择 Public,不勾选 README
- 点击
Create repository
在 在线简历 目录下打开终端,执行:
# 初始化 Git(如果还没有)
git init
# 添加所有文件
git add .
git commit -m "初始化在线简历"
# 关联远程仓库(把 YOUR_USERNAME 和 YOUR_REPO 换成你的)
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
# 推送
git branch -M main
git push -u origin main- 进入仓库 → 点击
Settings→ 左侧找到Pages - 在 Source 中选择
Deploy from a branch - 在 Branch 中选择
main,文件夹选/ (root) - 点击
Save
等待 1–2 分钟,你的简历将出现在:
https://YOUR_USERNAME.github.io/YOUR_REPO/
修改 index.html 后,执行:
git add .
git commit -m "更新简历内容"
git push页面会在几分钟内自动更新。
在仓库根目录新建 CNAME 文件,写入你的域名(如 resume.yourdomain.com),然后在域名服务商添加 CNAME 解析指向 YOUR_USERNAME.github.io。