git init
git add .
git commit -m "init: atom portal"
git branch -M main
git remote add origin https://github.com/你的用户名/atom-portal.git
git push -u origin main
然后进入仓库 Settings → Pages → Deploy from branch,选 main / root,约一分钟后拿到公网地址。
常见 404
| 现象 | 原因 | 处理 |
|---|---|---|
| 根路径 404 | Pages 分支没选 main | 检查 Pages 设置 |
| 文章页 404 | 本地没跑 build.py | 先构建再提交 |
| 样式丢失 | 路径大小写不一致 | Linux 服务器区分大小写 |
本地图片
文章里的图片放在 posts/img/ 子文件夹,md 中用相对路径引用即可,跟着仓库一起走: