hugo部署博客到github
1、创建blog
hugo new site myblog_pub
cd myblog_pub/
git submodule add https://github.com/chinanf-boy/gohugo-theme-yinwang.git themes/yinwang
2、修改配置
vi config.toml
[email protected]:/home/go/code/hugo_dir/myblog_pub/public# more ../config.toml
baseURL = "http://ypbsyy.github.io/"
languageCode = "en-us"
title = "我是yaopeng"
theme = "yinwang"
#pygmentsCodeFences = true
#pygmentsCodefencesGuessSyntax = false
#pygmentsStyle = "dracula"
#pygmentsOptions = ['linenos']
# 代码高亮/chroma,hugo默认自带
[params]
author = "yaopeng"
github = "yaopeng"
# gitlab = "yobrave"
#googleAnalytics = "****"
# 谷歌统计gtag
highlight = "dracula" # 默认样式 `github`
langs = ["go"]
# 默认加载 highlight.min.js,但 一些不支持的语言, 你自己添加,
# 其实也可以使用hugo自带的语法高亮器设置,不过我有点懒
# single = false
# 单页面的Home 按钮去除
# menus = true
# 我 想加更多目录
# backgroundColor = "#fbf6ec"
# 加点黄黄的背景色
3、创建github
4、部署到github
git submodule init
git submodule update
hugo --buildDrafts
cd public/
git init
git remote rm origin
git remote add origin https://github.com/ypbsyy/ypbsyy.github.io.git
git add -A
git commit -m "first commit"
git push -u origin master
5、访问网站