hugo的基本使用方法

1. 创建一个hugo站点

hugo new site /path/of/site

2. 创建一篇博文

hugo new post/first.md

3. 下载主题样式

下载单一主题样式

mkdir themes
cd themes
git clone https://github.com/zyro/hyde-x

如果想要下载所有的主题样式则使用以下命令, 但下载所有主题样式需要一定时间

cd themes
git clone --recursive https://github.com/spf13/hugoThemes .

4. 运行服务器

默认运行在1313端口, 绑定127.0.0.1
hugo server --theme=hyde-x --buildDrafts --watch
运行在80端口, 绑定在0.0.0.0
hugo server --theme=hyde-x --buildDrafts --watch -b 0.0.0.0 -p 80

5. 打开浏览器访问

粤ICP备18097692号


       

粤公网安备 44030602002477号