如何部署个人博客到码云或github
部署到云端github
注意github的仓库名为:你的用户名.github.io
1.在config.toml中改参数在:baseURL = “https://你的用户名.github.io”
2.生成public:
打开文件根目录的cmd或git bash here输入
hugo --theme=你的主题 – baseURL = “https://你的用户名.github.io”–buildDrafts
3.进入public
4.在该页面下打开git bash here
5.相继输入以下代码
git init
git remote add origin https://github.com/你的用户名/你的用户名.github.io.git
git add -A
git commit -m"my hugo"
git pull --rebase origin master
git push -u origin master
部署到码云
注意github的仓库名为:你的用户名
1.在config.toml中改参数:baseURL = “https://你的用户名.gitee.io”
2.生成public: (初始化你的博客)
打开文件根目录的cmd或git bash here输入
hugo --theme=你的主题
3.进入public的文档,在该文档下打开git bash here
4.相继输入以下代码:
git init
git add .
点之前有个空格
git commit -m “first commit”
git remote add origin https://gitee.com/你的用户名/你的用户名.git
git push -u origin master
如果第二次上传需要修改的内容:
在执行git push -u origin master之前先执行git pull origin master
5.进入之前你创建的库所在页面,刷新
6.鼠标打开服务,选择Gitee Pages,点击进入
7.选择强制使用HTTPS
8.启用服务
如果遇到博客主题不加载的情况请点击我.
本文详细介绍了如何将个人博客部署到GitHub Pages及码云Gitee Pages上,包括配置baseURL、生成public文件夹、使用Git进行版本控制等步骤。适合初次部署博客的用户参考。
2275

被折叠的 条评论
为什么被折叠?



