Hugo 博客搭建

本博客使用 Hugo 搭建,这里记录一下搭建过程。 Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again. 一、Hugo 基本使用 i. 命令使用 # Hugo 安装 brew install hugo # 新建博客 hugo new site hugo-blog # 添加主题(修改 config.yml 配置文件中 `theme: PaperMod`) git submodule add https://github.com/oudushu/hugo-PaperMod.git themes/PaperMod # 新建博文 hugo new posts/web-hugo-blog.md # 网站预览(http://localhost:1313/) hugo server # 生成静态文件(public 文件夹) hugo ii. 图片 图片资源存放在 static 文件夹中,我习惯每篇文章都新建一个文件夹存放图片,如:hugo-blog/static/image/web-hugo-blog/image-20220316160415439....

March 16, 2022 · Darren Ou