常用命令
hugo new site SITE_NAME
生成静态博客项目hugo server
启动本地服务器,加上 -D 可以渲染 draft=true 的文章hugo new post/new-content.md
在 post 下新建一篇文章hugo
生成站点静态文件(public 和 resources 目录)hugo list drafts/expired/future
列出草稿/过期/未来的文件
踩坑记
- 使用主题 Event 时, 文章必须放在
content/**post**/
目录下, 否则 Home 页不会展示文章链接, 文章内也不会展示目录 - 使用主题 Zzo 时, 要创建 Archive 页(类似 Event 中的 Home 页), 需要创建文件
content/archive/_index.md
(参考 How to automatically generate archive page content #47) - 使用主题 Zzo 时, 在 GigHub Actions 配置中必须启用 Hugo extended 模式, 否则构建会失败(参考Hugo setup)