hugo部署博客到github

1、创建blog

hugo new site myblog_pub
cd myblog_pub/
git init
git submodule add https://github.com/chinanf-boy/gohugo-theme-yinwang.git themes/yinwang

2、修改配置

vi config.toml

root@instance-x8rtph4n:/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、访问网站

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值