初始 Hugo
安装及主题配置
-
推荐使用 scoop 安装 Hugo
# 普通版 scoop install hugo # 扩展版 scoop install hugo-extended在后续使用过程中,如果出现以下报错,可以通过安装扩展版解决。 [1]
error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version -
生成站点
hugo new site path/to/your/blog -
安装主题 MemE [2]
# 安装 cd blog git init git submodule add https://github.com/reuixiy/hugo-theme-meme.git themes/meme # 更新 git submodule update --rebase --remote -
配置主题
-
替换 config.toml
打开站点文件夹,然后将 Hugo 默认生成的
config.toml删除,再进入themes/meme/config-examples/zh-cn/目录,将 MemE 提供的config.toml复制到站点根目录下 -
新建文章
hugo new "posts/hello-world.md" hugo new "about/_index.md" -
体验测试
hugo server -D
-
个性化
根据配置文件中的注释安装自己的需要配置即可,下面着重介绍下“品牌栏”的配置。
这个流程走下来,brand 就做好了,接下来把它用到主题中。
打开你的 SVG文件,给它添加一个名为 brand 的 class,比如:
# 修改前
- <svg xmlns="http://www.w3.org/2000/svg">
# 修改后
+ <svg xmlns="http://www.w3.org/2000/svg" class="brand">
接下来,在站点的 data 文件夹内新建一个 SVG.toml 文件,并添加一行:
brand = ''
最后,将你的 SVG 粘贴进 '' 内即可。