hugo博客在GitHub上进行部署(二)

创建新文章

hugo new 你的文档名/你的文章名.md

创建库

1.名称一定是:你的用户名.github.io 2.选择本地存储复制

部署到云端

1.在config.toml中改参数 2.生成public: 打开文件根目录的cmd或git bash here输入

hugo

3.进入public 4.在该页面下打开git bash here 5.相继输入以下代码

git init 
git add -A
git commit -am"init"
git branch -M main
git remote add origin https://github.com/你的用户名/你的用户名.github.io.git
(假如是我:git remote add origin https://github.com/HarryQing/HarryQing.github.io.git)
git push -f origin master
(无响应则再次运行同一代码,最多两次)
你的博客:https://你的用户名.github.io/
假如是我的博客:https://harryqing.github.io/

笔者

git init

git add -A

git commit -am"init"

git branch -M main

git remote add origin https://github.com/HarryQing/HarryQing.github.io.git

git push -f origin main