注意
本文最后更新于 2023-06-26,文中内容可能已过时。
注意
快速上手Hugo-blog指引。
记录常用命令,方便查阅。
更多详细内容请参考官方文档:https://fixit.lruihao.cn/zh-cn/documentation/getting-started/
Hugo快速开始
快速开始相关命令,前置条件,Hugo环境, 基于 hugo-extended
本文基于windows11,dos环境下命令,不过hugo命令,和git命令都是通用没有区别。
1
2
3
4
5
6
7
8
| #
hugo new site your_site_name
cd your_site_name/
# 初始化git ,使用git子模块 添加主题
git init
git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
# 更新同步主题版本
git submodule update --remote --merge
|
Hugo相关命令
1
2
3
4
5
6
7
8
9
10
| // 新建一个hugo站点
hugo new site yourSiteName
// 新建一篇文章
hugo new posts/notes.md
// 以production 环境运行 hugo 站点
hugo server -e production -D
// 这里注意 serve 是 server 两种写法都可以
hugo serve -e production -D
|
git相关命令
git clone 自动下载子模块
1
2
| //在执行 git clone 时加上 --recursive 参数
git clone --recursive https://github.com/example/example.git
|
如过忘记下载子模块可以执行下面的语句更新
1
| git submodule update --init
|