抽时间搭了一个基于GitHub Pages的博客,本文记录一下选用中用到的东西和细节。
组件 godaddy 域名注册 github pages hugo hugo中文站 hugo官网站 disqus disqus gitment gitment 免费全站https+cdn cloudflare travis-ci 域名注册 域名注册不再讲述,大家都是搞IT的应该都搞过。
配置github pages 创建一个仓库以自己的用户名开头 例 du2016.github.io 在该repo的配置中设置域名以及分组等信息
安装hugo MAC快捷安装
brew install hugo 访问github获取最新版本
https://github.com/gohugoio/hugo/releases 生成站点
hugo new site mysite 选择hugo主题 我使用的是hugo-tranquilpeak-theme
cd mysite rm -rf config.toml content/ static/ git clone https://github.com/kakawait/hugo-tranquilpeak-theme.git themes/hugo-tranquilpeak-theme cp -r themes/hugo-tranquilpeak-theme/{config.toml,content,static} ./ 编辑 config.toml填写个人站点信息
添加文章
hugo new post/install-conduit-on-k8s.md 创建的文章draft: true属性,即为草稿,如要发表该文章请改为false
![](https://du2016.github.io/img/hugo.png)