使用hugo在gitee上写blog

1. 安装hugo

1)下载

 Hugo Releases,选择hugo_xxx_Windows-64bit.zip(xxx位版本)。

2)设置路径

我的电脑-》属性-》高级系统设置-》环境变量

在path中加入hugo的解压后的目录。

例如:

D:\program\hugo_0.68

2. 使用hugo

1)生成站点

hugo new site \gitee\my\blog

2) 生成文章

cd gitee\my\blog
hugo new first.md

3) 安装皮肤

    例如:我的(hugo-theme-casper)

git clone https://github.com/vjeantet/hugo-theme-casper.git

把克隆下拉的仓库,拷贝到“themes”下。

4)设置站点配置

config.toml

baseURL = "https://xiaobin80.gitee.io/blog/"
languageCode = "zh-cn"
title = "我的技术blog"
theme = "hugo-theme-casper"
publishdir = "../blog"

3. 发布

1)clone gitee

git clone https://gitee.com/xiaobin80/blog.git

 把这个仓库放到,之前我们生成的“gitee”目录。

2)publish

hugo

注意:在发布的时候,我们的文章中的“draft=true”要去掉!

4.提交并更新

1)提交我们的仓库代码,具体操作见《Git客户端(Windows系统)的使用

2)在gitee上更新我们的blog

打开网址:https://xiaobin80.gitee.io/blog/

就可以看到我们用markdown写的blog了。

参考文档:

    1. https://www.gohugo.org/

猜你喜欢

转载自www.cnblogs.com/xiaobin-hlj80/p/12651114.html