如何用 hugo 搭建个人博客
Mac 用户
-
安装hugo
brew install hugo hugo version -
创建新的环境
hugo new site xxx.github.io-creator -
添加主题
cd xxx.github.io-creator git init xxxxxxxxx //主题下载地址 -
设置主题名
echo echo 'theme = "ananke"' >> config.toml -
新建文章
hugo new post/my first page.md -
写文章,将
draft: true改为 ``draft: false` -
运行
hugo server -D -
打开 http://localhost:1313/ ,会看到一个示例网站。
-
- 配置好
config.toml - 文章写在
./content/post
- 配置好
-
运行
hugo -D -
cd pablic/ -
git add . -
git commit -v -
git push
说明
具体操作参照hugo官方文档