下载Hugo
首先下载Hugo软件 github.com/gohugoio/hu…
然后解压,将解压后的路径添加到Path中
设置Hugo
进入官网,找到设置代码 gohugo.io/getting-sta…
- 确认
Hugo版本,hugo version - 新建
Hugo站点,文件夹名为Captain-Tab.github.io-creator
hugo new site Captain-Tab.github.io-creator // 创建命令
- 进入文件夹,并下载主题
cd Captain-Tab.github.io-creator
git init
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
- 添加主题到配置文件
echo 'theme = "ananke"' >> config.toml
- 添加博客目录,名为开博大吉
hugo new posts/开博大吉.md
- 运行本地
Hugo服务器
hugo server -D
- 设置主题和标题
baseURL = "https://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "ananke"
- 生成静态页面
hugo -D
关联GitHub 仓库
- 在
GitHub页面新建一个远程仓库,名为Captain-Tab.github.io-creator - 然后新建本地仓库,在
Captain-Tab.github.io-creator文件夹中,代码为
cd public
git init
git add .
git commit -v hello
- 接着关联远程仓库
git remote add origin git@github.com:xxxx/x.github.io.git
push -u origin master
- 最后在
GitHub的仓库设置界面,找到GitHub pages,进行浏览
购买域名,配置DNS
- 首先购买域名,推荐namesilo
- 然后添加四条A记录
- 检查是否正常
nslookup + 域名 - 最后添加域名,配置
GitHub Page