Zola
本文受众:Zola博客引擎, ametrine博客主题, 复现本博客网站的爱好者,以及
¯\(°_o)/¯me单独说明,若是我个人针对ametrine博客主题添加的网站特写会单独说明
tldr:直接去主题开发者 或 你熟知的 github.io 参考workflows中的部署yml文件进行本地部署复现
然后 根据 文档 和 AI 进行逐行熟悉 源项目 再 魔改成自己的
Blog-md 标签头
颜色
- 色相(Hue):颜色在色轮上的位置,范围 0–360 度。0 是红色、120 是绿色、240 是蓝色。
- 饱和度(Saturation):颜色的鲜艳程度,0% 是灰色,100% 是最鲜艳的纯色。
- 亮度(Lightness):颜色的明暗程度,0% 是黑色,100% 是白色。
可借助
Snipaste-截图贴图中的取色器获取到RGB值 , 在RGB转HSL在线网站转换即可
accent_color = ["red", "blue", "orange","green"] # 懒惰写法
accent_color = ["hsl(123, 33%, 60%)", "hsl(27.567572, 87%, 67%)"] # 更符合人类感知
hsl(123, 86%, 33%) # 柔和草绿
# Has several modes:
# - Use one of the presets (applies to both light and dark modes):
# accent_color = "<red, orange, yellow, green, blue, purple>"
# - Use a single HSL color for both light and dark modes:
# accent_color = "hsl(270, 50%, 60%)"
# - Use separate colors for light and dark modes (it's possible to mix both
# presets and HSL colors):
# Presets: accent_color = ["red", "blue"]
# Preset + HSL: accent_color = ["red", "hsl(270, 50%, 60%)"]
# HSLs: accent_color = ["hsl(270, 50%, 60%)", "hsl(27.567572, 87%, 67%)"]
#
# Custom colors must be in HSL format. You can also define your own colorRSS/Atom订阅
updated = 2026-10-15
date = 2026-10-15 # 该字段必须要有的归类
优先使用现有归类,除非 后续博客产出 过多,否则不单独 新增 归类
categories = ["Doc","Tracking"] # 需要持续迭代更新的帮助文档
字体字号
全局字体 位置:sass/fonts.scss (line 5)
:root {
--font-sans-serif: "Golos Text";
--font-monospace: "Commit Mono";
}主题的 body 直接消费它(themes/ametrine/sass/citrine/sass/base/_base.scss:33):
body {
font-family: var(--font-sans-serif), var(--font-system-ui), var(--font-emoji);
}所以改 –font-sans-serif 就能改全站默认正文/UI 字体;代码块仍走 –font-monospace。如果换成新字体,先在同一个文件里补 @font-face,再把变量指过去
+++
title = "文章标题"
date = 2026-10-21
[extra]
body_font_size = "19px" # 可选,不写则继承全局 21px
body_font = "pop"
+++| # | body_font取值 | 字体字典 | Duration |
|---|---|---|---|
| 1 | golos Golos Text | golos Golos Text | 主题默认字体 |
| 2 | pop | 华康 POP1 体 | Identify-V 中文 |
| 3 | essay | Essay Text | Identify-V 英文 |
| 4 | mono | Commit Mono | 等宽 |
| 1 | wenkai | 霞鹜文楷 | 主题默认字体 |
| 2 | fangsong | 仿宋 | Identify-V 中文 |
| 3 | sarasa | 纱黑体 | Identify-V 英文 |
| 4 | pingfang | 系统 PingFang SC(Apple 设备) | 等宽 |
加解密
个人功能
+++
title = "通过 Little Snitch 屏蔽网站"
description = "基础教程"
updated = 2026-06-21
date = 2026-06-20
[taxonomies]
tags = ["Network"]
[extra]
accent_color = ["hsl(145 22% 34%)", "hsl(145 28% 50%)"]
[extra.encryption]
encrypt = true
+++屏蔽RSS/Atom订阅
个人功能 正确写法是放在 front matter 顶层(不要放进 [extra]) 该文章会从根 feed 和所在板块 feed 中消失,文章本身仍能正常访问。它只影响订阅源,不影响页面发布;如果还想让它不进搜索,再另加 in_search_index = false
encrypt = true 的文章因为 post-build.mjs 的过滤,本身已经不会出现在 feed 里;include_in_feeds = false 更适合“不加密、但就是不想进 RSS”的普通文章。两者都写时也不冲突,include_in_feeds = false 会在 Zola 生成 feed 阶段就先排除。
+++
title = "不进入 RSS 的文章"
date = 2026-10-20
include_in_feeds = false
+++Banner
+++
title = "Untitled 2025.m3u"
description = "My musical preferences of 2025, in a playlist form."
updated = 2026-07-04
[taxonomies]
tags = ["Music", "Playlist"]
[extra]
accent_color = ["hsl(209.49, 35.76%, 32.35%)", "hsl(200.0, 15.19%, 69.02%)"]
banner = "banner.webp"
styles = ["blog/2025-playlist/style.css"]
+++Blog-md 内容主体
[!WARNING]
> [!WARNING]警告
看板
主题更新 -ametrine
以
ametrine主题为 当前核心主题
cd ~/00BlogZola
# ① 先回到主仓库当前记录的提交,确保是干净基线(可选但推荐)
git submodule update themes/ametrine
# ② 拉取新版主题:main 分支最新 + 初始化并递归更新嵌套子模块
# (--init --recursive 会拉取 sass/citrine,这是新版能编译的关键)
git submodule update --remote --init --recursive themes/ametrine
# ③ 先编译验证(与 CI 完全一致的完整流程用 ./build-site.sh)
zola build
# ④ 编译失败 → 撤销本次拉取,回到主仓库记录的旧提交
git submodule update themes/ametrine
git diff # themes/ametrine 应不再出现
git submodule status # 前面无 + / - 符号即已回到记录提交
#如果第 ④ 步提示本地有改动不让覆盖,加 --force:
git submodule update --force themes/ametrine
# 上述是给读者详解,以下是 个人一键命令使用的
cd ~/00BlogZola
git submodule update --remote --init --recursive themes/ametrine
if zola build; then
echo "✅ 新版主题编译通过(尚未记录,确认保留后再提交)"
else
echo "❌ 编译失败,自动撤销本次拉取"
git submodule update themes/ametrine
fi关键提醒
- 回退为什么有效:主仓库「记录的」子仓库提交始终是旧的 fc6f62c217ae, 只要你在成功之前不执行
git add themes/ametrine,git submodule update themes/ametrine(不带 –remote)就能把工作区拉回这个记录提交,相当于放弃新版。 - 确认保留新版时才提交:
git add themes/ametrine
git commit -m "upgrade ametrine theme"
提交之后,「记录提交」就变成新版了,此后第 ④ 步会回退到新版而不是旧版。- citrine 残留无害:回退后
themes/ametrine/sass/citrine这个目录可能还留在本地,旧版主题不引用它,不影响编译,不用特意删。 - 更确定的拉取方式(可选):如果不想依赖 –remote 对嵌套子模块的自动行为,也可以进子仓库手动拉取,与 CI 完全一致
cd ~/00BlogZola/themes/ametrine git fetch origin main git checkout origin/main git submodule update –init –recursive cd ~/00BlogZola
之后的编译验证和回退步骤同上。