3 Commits
Author SHA1 Message Date
witcher ca00daddf6 feat: release Terminal-Witcher 3.1.17 and project handoff
Ship responsive navigation, configurable profile and four-section homepage, article/life category separation, natural-ratio book covers, and independent border settings. Include release history and complete context handoff documentation.
2026-11-16 18:30:36 +08:00
WitcherCheung 0859e49946 Update README with theme description and links 2026-08-25 19:23:33 +08:00
witcher 0bd5123176 [fix] 修复主题文件放置位置错误的问题 2026-08-25 17:51:20 +08:00
30 changed files with 2417 additions and 499 deletions
+5
View File
@@ -0,0 +1,5 @@
# 项目约定
- 新会话开始时,先阅读根目录的 `HANDOFF.md`(快速交接)和 `PROJECT_CONTEXT.md`(需求、版本记录与验证背景),再结合当前源码和用户的新要求继续。
- 每次完成用户要求的主题修改后,将 `theme.yaml` 中 `spec.version` 的末位数字加 1;一次需求只递增一次,中间验证构建不递增。
- 完成后运行 `pnpm build`,提供 `dist` 中对应新版本的 Halo 主题安装包。
+42
View File
@@ -0,0 +1,42 @@
# 版本记录
## 3.1.17 — 2026-11-16 集中同步发布
本次将此前本地开发至 3.1.17 的成果集中同步到 Git。主题实际版本以 `theme.yaml` 的 `spec.version` 为准,Git 标签采用 `3.1.17`,安装包为 `theme-terminal-witcher-3.1.17.zip`。
### 当前版本的完整变化
- 重做固定导航:左侧品牌、右侧菜单,手机全屏导航及三横线/X 动画,支持键盘与焦点管理。
- 导航栏背景色和文字色接入自定义配色,滚动后显示半透明毛玻璃和浅分隔线。
- 首页采用文章/生活、阅读/作品集两排错开布局;左侧个人名片与右侧欢迎语均可配置。
- 文章使用正方形封面的竖向卡片,标题和摘要适当截断,四个区域统一使用“更多”。
- 修复文章分类误筛选:默认保留技术分类和未分类文章,完整文章入口指向归档。
- 首页生活分类及其子分类与普通文章分流;生活列表采用左侧小封面、右侧文字,无封面时不留空框。
- 书籍封面按原始比例完整显示;作品支持手动列表或项目集插件,附带开源仓库链接。
- 图片与卡片统一方角,主边框支持数字像素配置,默认 2px。
- 文章目录独立配置边框粗细和颜色,默认 1px 浅色,随明暗配色调整。
- 补齐设置说明、五套语言文案、项目约定及完整上下文交接文档。
### 验证与产物
- 发布前重新执行 `pnpm build` 和 `git diff --check`,核对 ZIP 版本、关键文件和完整性。
- 此前已通过真实 Thymeleaf 模板渲染及 Edge/Playwright 的分类、导航、响应式与边框配置场景;详细记录及当前测试工具可用性见 [PROJECT_CONTEXT.md](PROJECT_CONTEXT.md)。
- 发布页附主题 ZIP 和 `SHA256SUMS.txt` 校验文件;这是源码与安装包发布,不表示已安装到用户的线上 Halo。
## 此前的本地开发记录
以下是当前长会话中确认的开发版本,不为这些中间状态补造 Git 提交或标签。远程原有源码基线为 3.1.1 之后的 `0859e49`;原有真实标签 `3.1.0`、`3.1.1` 保持其原提交。
| 版本 | 主要变化 |
| --- | --- |
| 3.1.16 | 首页生活分类分流、生活列表左侧小封面 |
| 3.1.15 | 文章右侧目录完整外框、响应式与收起处理 |
| 3.1.14 | 主边框数字像素输入,默认恢复为 2px |
| 3.1.13 | 导航配色、自然比例书封、方角与主边框统一 |
| 3.1.12 | 名片完整外框 |
| 3.1.11 | 名片在左、欢迎语在右,手机同步顺序 |
| 3.1.10 | 细节版/简洁版欢迎区与快捷入口 |
| 3.1.9 | 可配置个人简介、照片与简历链接 |
| 3.1.8 | 修复同名“文章”分类误筛选,完整归档入口 |
更早的导航及首页改版不逐项猜测版本归属,详见 [PROJECT_CONTEXT.md](PROJECT_CONTEXT.md)。
+130
View File
@@ -0,0 +1,130 @@
# Halo 主题交接指南
> 整理日期:2026-11-16(Asia/Shanghai)
>
> 项目:`C:\Users\11789\Documents\Projects\Codex_ws\halo-theme-terminal`
>
> 当前主题:Terminal-Witcher,版本 **3.1.17**
>
> 阅读顺序:本文件 → [PROJECT_CONTEXT.md](PROJECT_CONTEXT.md) → 按任务查看源码。
>
> 本文依据当前会话与工作区整理,不要求接手模型能访问旧聊天或任何记忆插件。
## 目标
继续维护用户的 Halo 博客主题,以现有 Terminal 风格为基础迭代,而不是重新设计成另一套网站。用户希望简洁、方角、有边框、可配置;首页展示个人名片、欢迎语,以及错开的文章、生活、阅读、作品集四个区域。此前主题需求均已实现。用户要求保存 Markdown 交接后,又明确要求把源码、文档与版本同步到 Git;此次同步仍使用 **3.1.17**,没有新增待实现的界面需求。
## 当前状态
- 最新源码和安装包都是 **3.1.17**;最新改动是文章页右侧目录的独立浅色细边框设置。
- 目录外框默认 **1px**;颜色由主题边框色与背景色按 **25% / 75%** 混合,内层级辅助线也使用这个颜色。
- 设置入口:`主题设置 → 文章页 → 目录边框粗细(px) / 目录边框颜色`。
- 全站主边框是另一套配置,默认 **2px**,入口为 `全局样式 → 边线宽度(px)`;不要再让目录外框跟随这个粗细。
- 首页名片在**左侧 30%**,欢迎内容在**右侧 70%**;手机端先名片、后欢迎语。不是最初的“左欢迎、右名片”。
- 首页上排是**文章 70% / 生活 30%**;下排是**阅读 30% / 作品集 70%**。窄屏变成单列。
- 生活分类及其子分类的文章从首页“文章”区排除,只放在“生活”区;同时属于技术和生活分类时,**生活优先**。
- 生活列表是**左侧小封面、右侧标题/日期/摘要**,没有封面时不保留空图片框。用户已纠正过方向,不要改回右侧封面。
- 图片、卡片、目录、菜单等使用**方角**。此前的 8px 圆角和默认约 3px 粗边框都是历史设计,已被替换。
- 书籍封面按原图比例显示:宽度铺满,高度自动,不用固定 2:3 框产生上下空白,悬停时不放大裁切。
- 没有已知的未解决功能报错;但验证是本地模板渲染和浏览器验证,**不等于已在用户的线上 Halo 后台部署或验收**。
### 当前可用安装包
| 文件 | 状态 |
| --- | --- |
| `dist/theme-terminal-witcher-3.1.17.zip` | 最新安装包,2,636,011 字节;Git 同步前重新构建 |
| `dist/theme-terminal-witcher-3.1.16.zip` | 上一版本安装包 |
最新包 SHA-256:
```text
fc1f0ab2dc7bf875cfb2b9d5ba1dfc397a41c771c0c051ae21eca722016d1e73
```
2026-11-16 Git 同步前已重新执行 `pnpm build`,核对最新包内的 `theme.yaml`、`settings.yaml`、README、首页模板、布局模板和编译 CSS/JS 与工作区一致,ZIP 完整性检查通过,并生成 `dist/SHA256SUMS.txt`。此前聊天中的其他旧 ZIP、预览 PNG 在本次检查时已不在 `dist` 中,不要把历史链接当作当前存在的文件。
## 文件导航
| 文件 | 作用 |
| --- | --- |
| `AGENTS.md` | 用户的版本递增、构建交付约定;新会话阅读入口 |
| `CHANGELOG.md` | 3.1.17 集中发布说明与此前本地版本记录 |
| `PROJECT_CONTEXT.md` | 完整需求、设置字段、版本演进、回归场景、历史踩坑 |
| `theme.yaml` | 主题身份、Halo 最低版本、唯一需要递增的主题版本号 |
| `settings.yaml` | Halo 主题设置表单;首页、配色、全局边框、目录设置都在这里 |
| `templates/index.html` | 首页入口,调用首页模块 |
| `templates/modules/home.html` | 首页数据读取、分类分流、名片/欢迎语、四块内容及卡片片段 |
| `src/styles/home.scss` | 首页布局、卡片、书封、生活缩略图;首页专用宽度与 PJAX 恢复 |
| `templates/layout.html` | 全站布局及把配置转换成 CSS 变量的内联样式 |
| `templates/modules/header.html` | Logo/网站标题、菜单、手机菜单按钮;顶层“文章”链接修正 |
| `src/module/navigation.js` | 桌面子菜单、手机全屏导航、关闭/焦点处理、滚动状态 |
| `src/module/header.js` | 页头初始化;接入导航模块 |
| `src/styles/header.scss` | 固定页头、透明毛玻璃、滚动后细分隔线、品牌和按钮 |
| `src/styles/menu.scss` | 桌面下拉、手机全屏菜单、左对齐及子分类缩进 |
| `src/styles/scheme.scss` | 内置配色与语义颜色变量,含导航背景变量 |
| `src/styles/main.scss` | 全站默认变量;主边框默认 2px、方角默认 0 |
| `src/styles/toc.scss` | 文章目录外框、目录层级线、尺寸和滚动;独立细边框变量 |
| `src/module/post.js` | tocbot 目录生成、显示/收起、定位与窗口变化处理 |
| `templates/post.html` | 真实文章内容和目录 DOM |
| `templates/category.html` | 分类文章列表;空分类保留“查看全部文章”入口 |
| `src/styles/post.scss` | 文章与旧文章列表样式;封面方角 |
| `src/styles/portfolio.scss` | 作品集页面;主边框已统一 |
| `src/styles/moment.scss` | 动态媒体样式;方角和主题边框 |
| `src/styles/variables.scss` | Sass 断点;手机导航边界与 JS 的 899px 保持同步 |
| `src/styles/style.scss` | 样式入口;首页样式最后导入 |
| `i18n/default.properties`、`en.properties`、`es.properties`、`zh_CN.properties`、`zh_TW.properties` | 新增首页、导航、简介等文案;注意五套语言同步 |
| `README.md` | 使用说明、配置说明、CSS 变量和构建文档 |
| `build.js`、`package.json`、`pnpm-lock.yaml` | esbuild/Sass 构建、主题打包;不是 React/Vue 项目 |
| `templates/assets/dist/` | 编译资源,修改源文件后由构建生成,不要只改这里 |
## Git 与工作区
- 实际 Git 远程 `origin`:`https://gitea.witchercheung.cn/witcher/halo_theme_terminal.git`,主分支 `main`。不要因为主题元数据中保留了 GitHub 链接,就擅自推到另一个服务。
- 同步前源码基线是 `0859e49`(`Update README with theme description and links`),主题为 3.1.1;本次集中纳入其后开发至 3.1.17 的源码和文档。历史未提交状态不再作为新会话的当前状态依据。
- `src/module/navigation.js`、`src/styles/home.scss`、`templates/modules/home.html` 和交接 Markdown 均属于需要纳入版本控制的成果;不要漏掉这些过去未跟踪的文件。接手时以实际 `git status --short` 为准。
- 此次发布基准为 `main` 和标签 `3.1.17`,可用 `git rev-parse 3.1.17^{commit}` 查询确切提交。原有真实标签 `3.1.0`、`3.1.1` 保留原提交;不为中间本地版本补造历史。
- [3.1.17 发布页](https://gitea.witchercheung.cn/witcher/halo_theme_terminal/releases/tag/3.1.17) 用于分发安装 ZIP 与 SHA-256 校验文件。具体同步结果可用远程 refs 与发布页复核。
- 其余已修改文件主要就是上表中的模板、样式、设置、翻译、README 与 `theme.yaml`。
- `.gitignore` 忽略 `dist` 和 `node_modules`;交付 ZIP 不会自动进入版本控制。
- 本次交接文档应保留在项目中,方便用户长期给其他模型阅读;不要因为技能模板称其为“scratch file”而擅自删除或忽略。
## 关键历史错误与不要重复的做法
1. **按名为“文章”的分类自动筛选,曾让首页文章消失。** 用户菜单中的“嵌入式、STM32F407、机器人、ROS2、Web、前端、后端”等链接缩进,不代表后台分类已经建立同样的父子关系。3.1.8 修复为默认不要求归入“文章”分类。当前只增加了用户明确要求的“排除生活文章”,不要再次要求用户搬迁技术文章。
2. **不能先取最新 6 篇再排除生活文章。** 这会在近期生活文章很多时让普通文章卡片不足或为空。当前存在生活分类时先读取公开文章列表、排除隐藏和生活文章,再限制展示数量。
3. **Halo 2.22 的 `postFinder.list({...})` 没有可随意添加的排除分类参数。** 源码核对过该版本支持的字段。`size: 0` 也不是无限读取,会被重置为最多 1000。当前用官方 `listAll()` 避免任意截断,再在模板中过滤。
4. **不要依赖旧版分类 `spec.children`。** 当前用 `categoryFinder.getBreadcrumbs()` 判断后代关系,避免旧字段在新 Halo 版本中不再更新的问题。
5. **Thymeleaf 的 `#lists.containsAny` 不存在。** 实测报错为 `EL1004E: Method call: Method containsAny(...) cannot be found on type org.thymeleaf.expression.Lists`。当前使用嵌套集合选择和 `#lists.contains`。嵌套选择中访问外部变量用 `#vars`。
6. **书封固定比例 + `object-fit: contain` 会留白。** 必须一起取消书封外框固定比例,令图片 `height: auto; aspect-ratio: auto`;书封悬停缩放也已经取消。
7. **全屏正文媒体宽度会误伤首页图片。** `.content img` 的正文最大宽度限制不能套到首页各类封面;`home.scss` 顶部已有更具体的覆盖,包含生活缩略图。
8. **目录边框不能只写在全屏或小于 1400px 的媒体规则里。** 过去会导致普通大屏没有外框。现在外框直接写在 `.toc.toc-visible`,折叠时不显示框。
9. **不要让目录重新跟随全局 2px 主边框。** 用户明确认为太粗、太深;3.1.17 已分成独立 1px 浅色边框,设置在“文章页”。
10. **不要恢复旧设计方向。** 手机菜单最终左对齐;名片最终在欢迎语左侧;生活缩略图最终在文字左侧;图片最终为方角。用户确实曾提出过相反方向,后续消息已经覆盖。
## 验证状态与环境限制
- 之前已执行成功的 `pnpm build` 和验证场景见 [PROJECT_CONTEXT.md](PROJECT_CONTEXT.md)。3.1.17 已打包成功。
- 历史验证使用了真实 Thymeleaf Spring6 模板引擎和 Edge/Playwright,但通过假 Finder 数据渲染,不是用户线上 Halo 的直接会话。
- 历史脚本放在 `C:\Users\11789\AppData\Local\Temp\halo-home-template-check`。**2026-11-16 检查时这个目录存在但为空**;Java 类、classpath、浏览器脚本和渲染 HTML 均不能假定还在。
- 本次未重建已丢失的测试工具,未重新运行整套历史浏览器/模板回归;Git 同步前另外重跑了构建、YAML/设置身份与字段检查、关键文件/ZIP 一致性及完整性检查。
- 项目没有 `pnpm test` 脚本。不要捏造测试命令或声称临时脚本已随源码保留。
- 当前会话可见的记忆工具检索失败:`The worker could not complete this request. Retry after checking the worker connection.` 未获得可引用的观察 ID,交接内容不依赖记忆服务。
## 接手后的具体步骤
1. 阅读 `AGENTS.md` 和这两份交接文档;运行 `git status --short`、检查 `theme.yaml` 的实际版本,防止文档在后续协作中滞后。
2. 等待或理解用户的新需求。目前没有未完成的主题功能,不要自动改动 UI、重构分类逻辑或升级发布。
3. 修改时按上表定位源文件。配置功能通常需要同时修改 `settings.yaml`、`templates/layout.html` 和对应 SCSS;界面文案变更注意五套 i18n。
4. 做与修改相称的验证。涉及分类时保留技术/未分类文章,并验证生活子分类、多分类、隐藏文章及“先过滤再限制”;涉及目录时验证粗细/颜色独立、旧配置、0 值、手机与折叠。
5. 每完成一项新的**主题修改需求**,只将 `theme.yaml` 的 `spec.version` 末位数字加 1;当前基线为 3.1.17,下一项主题需求应是 **3.1.18**。本次上下文保存与 Git 同步没有新增主题功能版本。
6. 执行 `pnpm build` 和 `git diff --check`,检查 `dist/theme-terminal-witcher-<版本>.zip`,然后用中文提供安装包路径。中间验证构建不再重复加版本。
7. 本轮用户已明确授权提交、推送和整理版本;后续新的任务仍按用户当时的授权范围执行,不把 Git 发布误称为已部署到用户的 Halo。
## 给新窗口的开场提示
```text
请先阅读项目根目录的 AGENTS.md、HANDOFF.md 和 PROJECT_CONTEXT.md,
检查当前源码与版本,然后基于这些上下文继续。
最新已完成版本是 3.1.17;先核对 main、版本标签及工作区状态,保留已有修改,
以我接下来发送的新需求为准。
```
+337
View File
@@ -0,0 +1,337 @@
# Terminal-Witcher 完整上下文与维护记录
> 整理于 2026-11-16(Asia/Shanghai)。这是对本次长会话的结构化记录,不是逐字聊天转录。
>
> 快速接手先看 [HANDOFF.md](HANDOFF.md)。需求发生冲突时,按下文“最终状态”和用户后续新消息执行,不要回退到历史方案。
## 一、项目与协作方式
- 工作目录:`C:\Users\11789\Documents\Projects\Codex_ws\halo-theme-terminal`。
- 主题:Terminal-Witcher;`metadata.name: theme-terminal-witcher`。
- Halo 最低版本:`>=2.22.0`;当前 `spec.version: 3.1.17`。
- 作者与站点来自现有配置:WitcherCheung,`https://witchercheung.cn`。
- 用户要求直接在这套 Halo 主题上修改,维持现有风格,中文沟通。用户会根据实际安装后的截图逐步调整。
- 当前前端为原生 JS ES 模块 + SCSS + Thymeleaf;`pnpm` 管理依赖,`esbuild` 构建,`@halo-dev/theme-package-cli` 打 ZIP。
- 用户希望每完成一个主题需求,版本末位自动 +1,并执行 `pnpm build` 提供对应 ZIP;同一需求内只递增一次。
- 任务只需文档时不新增主题版本。本次交接整理没有执行新的主题发布。
- 随后用户明确要求“推到 git 上,版本啥的都弄清楚,该推的都推了”。本轮已授权集中提交和同步现有 3.1.17 成果、真实版本标签与安装包发布;不把这次同步算作新主题功能版本。
- 不需要每个可逆编辑都重新请求许可;不要只说“能改”或给计划而不完成用户授权的修改。
- 没有线上 Halo 后台授权/会话、没有生产部署结果;不要把本地浏览器样例当线上真实文章内容。
## 二、用户最终确认的视觉与交互方向
### 顶部导航
1. 原来的顶部条(站名黑块、斜纹、搜索/配色等按钮那一行)已移除,保留下方导航并重做。
2. Logo 与网站标题放左侧,导航文字整体放右侧;“首页”菜单项去掉,品牌仍可回首页。
3. 导航保持在顶部。实际实现是 `position: sticky; top: 0`。
4. 当前页头高度默认桌面 64px,手机 56px;以 SCSS 为准,不要根据早期截图擅自改数值。
5. 页面位于最上方时不显示底部浅分隔线;滚动超过 8px 后加 `is-scrolled`,才显示浅分隔线与半透明毛玻璃。
6. 毛玻璃为基于导航背景色的 72% 混色,`blur(14px) saturate(140%)`,用户曾要求更透一些。
7. 桌面可展开项使用紧凑箭头,鼠标移入或键盘操作可展开。菜单文字与箭头间隙已经缩小。
8. 手机宽度边界为 **899px**:导航文字折叠为三横线;点击立即响应,从右侧进入覆盖全页面的导航,按钮动画变 X。菜单入场动画约 240ms,没有额外等待延时。
9. 手机展开内容最终为**左对齐**,子分类缩进 `2em`。早期“右对齐”被用户纠正。
10. 手机菜单有关闭、Escape、焦点/背景 inert 等行为;继续修改时保留这些功能。
11. 用户最新偏好是整个站点方角,因此桌面下拉菜单也已从早期圆角改为方角。
### 欢迎区和名片
1. 用户拒绝过一张改变整体风格的 AI 设计图。后续以现有 Terminal 字体、色彩、虚线分隔和排版为基础实现,不再整套换风格。
2. 欢迎标题沿用“欢迎参观我的博客”及终端光标效果;欢迎区本身没有完整外框。
3. 欢迎标题靠左,说明文字在**欢迎内容自身的区域内**靠右。
4. 最终顺序:**左名片、右欢迎**。默认名片占 30%、欢迎占 70%,可配置为 50% / 50%。
5. 手机端先名片,再欢迎语。
6. 名片文字**左对齐**,照片位于名片内部右侧;照片可选,也可以只显示照片。
7. 名片配置包括姓名/昵称、身份方向、简介、照片、关于我或简历链接。没有预设虚构简介或真实人物照片。
8. 简介按纯文本转义输出并保留换行;欢迎公告内容仍支持可信 HTML。
9. 简历链接可能是 PDF,因此名片链接没有强行加 `data-pjax`。
10. 名片当前有完整主题主边框,方角、浅底色。不要退回只有一侧的细分隔线。
11. `intro_style: detailed` 为默认细节版:淡电路走线装饰、简介浅底色、欢迎内容底部细分隔,以及文章归档/作品集快捷入口。社交图标也收在欢迎内容底部。
12. `intro_style: plain` 为简洁版;关闭名片后欢迎区恢复全宽。仅名片字段为空时不显示虚构占位内容。
### 首页四块布局
```text
┌────────────────┬────────────────────────────────┐
│ 个人名片 30% │ 欢迎内容 70% │
└────────────────┴────────────────────────────────┘
┌────────────────────────────────┬────────────────┐
│ 文章 70% │ 生活 30% │
└────────────────────────────────┴────────────────┘
┌────────────────┬────────────────────────────────┐
│ 阅读 30% │ 作品集 70% │
└────────────────┴────────────────────────────────┘
```
- 不是贯穿整页的固定两列侧栏;是上下两排比例错开的布局。
- 首页默认最大宽度 1440px,页头在首页与内容对齐。离开首页后恢复普通页面宽度。
- 实现依靠 `.homepage` 标记与 `:has()`,适应 PJAX 替换 `.content` 后的页面变化,不依赖只在初始页面执行的 body class。
- 上排文章/生活保持近似高度;窄屏按文章、生活、阅读、作品集顺序堆叠。
- 四块区域的右侧入口统一为**“更多”**,不要混用“全部笔记”“全部作品”。
### 文章卡片
- 区块名是“文章”,不是 Note。
- 竖向卡片,上方正方形封面,下方标题、摘要、日期,可显示置顶与标签。
- 自动模式按文章区实际宽度显示两列或三列;窄屏一列,可手动指定 2/3 列。
- 默认 6 篇,支持设置 1–12 篇。不是强制所有文章都在首页一次显示;完整列表走“更多”或导航“文章”。
- 标题最多两行、摘要最多三行;完整标题仍在链接 `title` 和文章页中,不丢内容。
- 没封面时用 `>_` 等终端字符占位,保留卡片比例。
- 悬停有轻微上移和图片缩放,键盘聚焦有反馈;减少动态效果时关闭位移/缩放。
- 最终使用方角与可配置的主边框,默认 2px。
### 生活列表
- 以实际文章分类读取,包含子分类。
- 自动匹配分类显示名 `生活` 或 slug `life`;也能在设置中明确选择分类。
- 首页“文章”排除这个生活根分类及其所有后代。文章同时勾选技术和生活时,生活优先。
- 生活行是**左图、右文**;右侧显示标题、日期和摘要,图文之间有小间距。
- 缩略图是约 64–88px 的方形图,使用原文章封面,点击可进入文章;没有封面时整行纯文字,不留空框。
- 生活标题最多两行,保留完整链接标题提示;摘要最多三行。
- 默认最多显示 6 条;“更多”进入实际生活分类的永久链接。
- 用户只需在文章编辑页选择生活分类并填写封面。主题不迁移后台分类、不修改文章内容。
### 阅读与作品
- 阅读手动维护书名、封面、一句话点评、可选阅读笔记链接,每行两本,默认首页 4 本,可配置。
- **书封采用原图比例**:宽度铺满、高度自然变化,不固定 2:3 框、不变形、不额外留上下空白。
- 书封悬停只提供边框颜色反馈,不缩放裁切。未配封面才显示书名占位。
- 点评保持一行省略并保留完整提示;不要误认为这是书封没显示全的同一个问题。
- 阅读“更多”默认 `/read`。用户尚未创建独立页面时,主题只提供链接,不会代为创建后台页面;创建别名为 `read` 的页面后可访问,也可自定义链接。
- 作品类似产品图 + 产品介绍,可配置手动列表。
- 自动模式可读取已启用的 `portfolio` 项目集插件;没有插件时走手动数据,**不要在插件可用性判断外直接调用 `projectFinder`**。
- 作品可显示 GitHub/开源仓库链接;“更多”默认 `/portfolio`,允许修改。
### 方角、主边框与目录的例外
- 用户最初喜欢轻圆角,但后续明确要求“整个网站四四方方、有边框”。最终方角为准。
- `--radius-theme-border: 0`;首页的 `--radius-home-image` 引用它,不再固定 8px。
- 主边框曾调粗至约 3px,用户认为过粗;3.1.14 已恢复默认 **2px**。
- `global_style.border_width_px` 为直观数字输入,0–12,步长 0.5;填写后优先于旧的 CSS 文本配置。
- `global_style.border_width` 作为高级 CSS 兼容值仍保留。像素值留空时使用它,两项都空则使用 2px。
- **文章目录**最终独立配置:默认 1px 浅色,不再继承全局主边框粗细;这是用户 3.1.17 的最新要求。
- 目录颜色留空时按主题边框色 25% 与背景色 75% 混合,随明暗模式切换;目录内部层级线也用该颜色。
- 目录颜色手动选择后是固定色;宽度为 0 时只隐藏外框,收起时始终不显示目录面板边框。
## 三、设置字段速查
### 首页 `index_page`
| 字段 | 用途/当前默认 |
| --- | --- |
| `intro_style` | `detailed` / `plain`,默认细节版 |
| `notice_title`、`notice_content` | 欢迎标题与公告 HTML;实际用户内容由 Halo 保存 |
| `profile_enable` | 显示左侧名片,默认 true |
| `profile_split` | `aligned` 为左 30% / 右 70%;`equal` 为左右等宽 |
| `profile_name`、`profile_role`、`profile_bio` | 姓名、身份、纯文本简介;默认空 |
| `profile_photo`、`profile_url` | 可选照片与简历/关于我链接;默认空 |
| `show_sns` | 显示配置的社交入口 |
| `article_source` | `all` 默认:所有非生活的已发布文章;`category` 才启用文章分类选择 |
| `note_category` | 主动选择分类模式时读取,不能因名字为“文章”自动生效 |
| `article_columns` | `auto` / `2` / `3` |
| `note_limit` | 默认 6,范围 1–12 |
| `life_category` | 留空自动匹配生活;手动选择优先 |
| `life_limit` | 默认 6,范围 1–6 |
| `books`、`book_limit` | 书架条目和首页书籍数量 |
| `books_more_url` | 默认 `/read` |
| `project_source`、`projects`、`project_limit` | 作品来源、手动作品、首页数量 |
| `projects_more_url` | 默认 `/portfolio` |
### 配色 `color_scheme.custom_color_schemes[]`
| 字段 | 用途 |
| --- | --- |
| `id`、`background`、`text`、`accent` | 自定义配色基本字段 |
| `advanced` | 打开高级颜色设置 |
| `navigation` | 导航文字、网站标题、手机菜单按钮颜色 |
| `navigation_background` | 导航栏背景;同时应用于桌面下拉和手机菜单;空则继承页面背景 |
| `border`、`border_accent`、`border_emphasis` | 普通、交互、强调边框语义颜色 |
- 设置自定义方案后,还需选择对应浅色或深色方案为 `custom`,填写 `custom_light_scheme` / `custom_dark_scheme` 为该 ID。
- 导航下拉 hover 背景用导航文字色、文字用导航背景色,不能继续套用页面的反色变量,否则独立背景配色可能出现同色文字。
- 不要为所有内置配色硬编码导航背景;默认变量引用页面背景即可,保证旧自定义方案兼容。
### 全局样式 `global_style`
| 字段 | 用途 |
| --- | --- |
| `border_width_px` | 数字像素输入,优先级高;允许 0 |
| `border_width` | 兼容既有的 `1px` / `calc(...)` 等 CSS 值 |
| `border_style` | 主边线样式 |
| `table_border_width`、`table_border_style` | 表格独立设置,仍保留 |
| `title_divider_style` | 标题分隔线样式 |
### 文章页 `post_page`
| 字段 | 用途/默认 |
| --- | --- |
| `show_toc` | 显示文章目录 |
| `toc_default_open` | `auto` / `open` / `closed` |
| `toc_border_width_px` | 默认 1,范围 0–6,步长 0.5;留空按 1px 回退 |
| `toc_border_color` | 默认空,自动浅色;可选择固定颜色 |
### 关键 CSS 变量
| 变量 | 当前意义 |
| --- | --- |
| `--width-theme-border` | 全站主边框,默认 2px |
| `--radius-theme-border` | 方角,默认 0 |
| `--color-theme-border` | 主边框颜色,默认从主题文字色派生 |
| `--color-theme-navigation` | 导航文字 |
| `--color-theme-navigation-background` | 导航与菜单背景,默认引用页面背景 |
| `--width-theme-toc-border` | 目录独立宽度,默认 1px |
| `--color-theme-toc-border` | 目录独立浅色,默认 `color-mix(in srgb, var(--color-theme-border) 25%, var(--color-theme-background))` |
## 四、文章分类数据读取的维护要点
实现位置为 `templates/modules/home.html` 根节点的 `th:with`:
1. 读取所有分类,自动或按设置找到生活根分类和可选文章根分类。
2. 用 `categoryFinder.getBreadcrumbs(metadata.name)` 判断分类是否属于根分类的后代,投影为分类 ID 列表。
3. 没找到生活分类时沿用原来的分页文章查询,避免升级后隐藏原有文章。
4. 找到生活分类时用 `postFinder.listAll()` 获取公开文章列表;过滤 `status.hideFromList == true`,按需应用文章分类筛选,再排除任一分类属于生活树的文章。
5. 在过滤后的结果上按 `note_limit` 渲染卡片,保持原始 Finder 排序,不先截断最近 6 条。
6. 生活区另用 `postFinder.list({page: 1, size: lifeLimit, categoryName: ..., sort: {'spec.publishTime,desc'}})`,该接口会包含子分类。
7. 未分类文章仍保留在默认文章区;仅主动选择文章分类模式时才按指定技术分类限制。
8. 首页排除生活不意味着归档或导航“文章”入口排除生活,完整归档仍是 `/archives`。
已核对的官方资料,便于接手者复查(不要凭空添加 API 参数):
- [Halo 文章 Finder 文档](https://docs.halo.run/developer-guide/theme/finder-apis/post)
- [Halo 分类 Finder 文档](https://docs.halo.run/developer-guide/theme/finder-apis/category)
- [Halo 2.22 PostFinderImpl](https://raw.githubusercontent.com/halo-dev/halo/v2.22.0/application/src/main/java/run/halo/app/theme/finders/impl/PostFinderImpl.java)
- [Halo 2.22 PageRequestImpl](https://raw.githubusercontent.com/halo-dev/halo/v2.22.0/api/src/main/java/run/halo/app/extension/PageRequestImpl.java)
`listAll()` 比只取少量文章的数据量大。以后若确实需要针对大站点做性能优化,应保留现有的正确性:生活后代分类、多分类优先级、公开/隐藏状态、排序和排除后补足数量。当前没有待办性能修复,不要以优化为由擅自改回会漏文章的方案。
## 五、版本演进记录
早期导航/四块首页迭代与 3.1.5–3.1.7 的具体逐项对应无法从现存文件完整确认,因此不虚构精确版本归属。以下 3.1.8 起的对应来自当前会话的实际交付记录。
| 版本/阶段 | 主要内容 |
| --- | --- |
| 早期导航改版 | 删除顶部条;品牌左、菜单右;去首页菜单;固定页头、桌面展开、手机全屏菜单与 X 动画;手机最终左对齐;滚动后浅分隔线与更透的毛玻璃 |
| 早期首页改版 | 去掉欢迎外框、标题左说明右;四块错开布局;Note 改为文章;竖卡、方封面、标题/摘要截断;统一“更多”;阅读 `/read`、作品 `/portfolio` 与 GitHub 入口 |
| 3.1.8 | 修复“文章分类”误筛选造成技术文章消失;默认读取所有已发布文章;导航“文章”进入 `/archives`;空分类提供完整文章入口 |
| 3.1.9 | 欢迎区与可配置个人简介左右分块;可选照片/简历链接、比例选择和手机布局 |
| 3.1.10 | 细节版/简洁版欢迎区;淡电路纹理、简介底色、归档和作品集快捷入口、社交入口整合 |
| 3.1.11 | 左右交换:名片左 30%、欢迎右 70%;手机先名片再欢迎 |
| 3.1.12 | 名片加完整主题边框 |
| 3.1.13 | 导航背景/文字独立配色;书封按原比例铺满;全站方角;边框一度加粗至约 3px |
| 3.1.14 | 增加全局边线数字像素输入;兼容旧 CSS 值;默认主边框调回 2px |
| 3.1.15 | 文章页右侧目录在所有布局/宽度下显示外框,使用主题边框与内边距 |
| 3.1.16 | 首页文章/生活分流,生活子分类与多分类处理;生活列表左侧小封面、右侧文字 |
| **3.1.17** | **目录边框独立粗细和颜色设置;默认 1px 浅色,内部层级线同步调浅** |
| 本次文档整理 | 保存这两份 Markdown 并增加 AGENTS 阅读入口;不新增主题版本 |
| 本轮 Git 同步 | 使用已有 3.1.17 集中提交源码与交接说明,维护真实标签,补充 CHANGELOG 并分发安装包 |
## 六、历史验证记录
### 哪些是历史已验证,哪些是当前实查
- 以下自动化场景是在此前实现过程中通过的,不能因为写在这里就声称 2026-11-16 又重跑了一遍。
- 2026-11-16 Git 同步前重新执行 `pnpm build`,确认源码版本、Git 状态、主题/设置 YAML 身份及字段、现存产物、关键 ZIP 文件一致性与 ZIP 完整性;生成了 `dist/SHA256SUMS.txt`。没有重跑已丢失的历史回归工具。
- 临时测试目录现在为空,预览图片现在也不在 `dist` 中。要重新验证或截图,需要重建工具或使用可访问的 Halo 环境。
### 历史工具结构
- 临时目录:`C:\Users\11789\AppData\Local\Temp\halo-home-template-check`。
- 模板测试:`HomeTemplateCheck.java`,Thymeleaf Spring6 3.1.3 + SpringEL、Jsoup、SnakeYAML;假 Halo Finder/插件数据,实际渲染项目 `index.html`、布局、首页模块及部分分类/归档。
- 曾有 `pom.xml`、`classpath.txt`、`rendered/`。依赖版本细节未完整保留,重建时重新核实,不要编造。
- 浏览器测试:本地 HTTP 服务提供渲染结果和实际 `templates/assets/dist` 资源;使用 Playwright 驱动 Edge。
- 当时的 Playwright 模块路径:`C:/Users/11789/AppData/Local/npm-cache/_npx/e41f203b7505f1fb/node_modules/playwright`。
- Edge:`C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`。
- Java 编译器:`C:/Program Files/Java/jdk-21.0.12.1/bin/javac.exe`。
- 本次实查上述三个软件路径仍存在;**测试脚本本身已经不在临时目录中**。
历史脚本名称供重建时理解用途,不代表当前存在:
| 脚本 | 验证内容 |
| --- | --- |
| `HomeTemplateCheck.java` | 完整 Thymeleaf 渲染和分类/旧设置/插件/独立边框回归 |
| `data-review.cjs` | 空“文章”父分类、独立技术分类、完整归档和导航链接 |
| `cards-review.cjs` | 卡片布局、标题截断、封面、悬停/焦点、明暗主题、PJAX 宽度恢复 |
| `intro-review.cjs`、`intro-swap-review.cjs` | 名片/欢迎顺序、比例、手机布局、空/纯图/纯文状态 |
| `square-nav-books-review.cjs` | 导航独立配色、滚动毛玻璃、手机菜单、方角粗细与自然比例书封 |
| `border-width-review.cjs` | 主边框 2px 默认、数字 1.5、0、旧 CSS 与清空回退 |
| `toc-frame-review.cjs` | 目录外框、全屏、宽窄屏、折叠行为 |
| `life-split-review.cjs` | 生活分流、左图右文、无封面回退、手机、显式分类和自定义生活分类 |
| `toc-soft-border-review.cjs` | 目录默认 1px 浅色、独立自定义色/宽度、0、旧配置与明暗切换 |
### 必须保留的回归场景
1. 旧配置没有新字段时仍可渲染。
2. 名为“文章”的空分类存在,技术文章在独立分类或未分类时仍显示;无需迁移到“文章”分类。
3. 自动/手动生活分类、生效根分类的二级和三级后代。
4. 一篇文章同时属于生活后代和技术分类时,只出现在首页生活区。
5. 最近连续超过 1000 篇生活文章时,排除后仍能补足六篇普通文章。历史测试构造过 1005 篇生活文章。
6. 未分类文章保留;`hideFromList` 的文章不出现在普通文章区。
7. 全部都是生活文章时,文章区显示空状态,生活区仍正常显示。
8. 主动选择技术分类时包含其后代,并继续排除生活。
9. 没有生活分类或配置的分类被删除时,不隐藏原有普通文章。
10. 生活封面在左、间距正常、文字在右;无封面不留占位;封面/标题链接一致,方角和配置粗细生效。
11. 阅读封面不同比例时无图片框额外留白,未发生变形;全屏正文媒体限制不影响首页封面。
12. 自定义导航色应用于页头、下拉、手机全屏菜单;hover 文字可见;滚动有毛玻璃,页顶无底部分隔线;旧方案无导航背景字段时跟随页面背景。
13. 主边框数字 1.5、0、清空、旧 CSS 值;0 不能被错误当作“没有配置”。
14. 目录外框独立于全局主边框;默认 1px 浅色;自定义宽度/色、0、清空、旧配置、明暗切换;收起不显示外框。
15. 未启用 portfolio 插件不调用不存在的 `projectFinder`;手动模式在插件启用时仍可优先使用手动数据。
16. 手机菜单的全屏、三横线/X、左对齐、子分类缩进、焦点、关闭和 reduced-motion 行为。
17. PJAX 离开首页后恢复普通内容宽度,页头宽度也恢复。
历史浏览器宽度覆盖包含 1910、1440、1280、1024、900、899、768、430、375、320px;不要为小改动机械重复所有场景,按受影响功能选择适当检查。
### 测试与截图的已知陷阱
- Playwright 对不存在的可选元素调用 `boundingBox()` 会等待 30 秒后失败。应先查 `count()`;缺照片/缺欢迎语是支持的合法状态。
- 导航颜色有约 160ms 过渡;切换配色或滚动后立刻读颜色可能得到上一帧。历史检查会等待约 240ms。
- 桌面三横线按钮是隐藏的,其手机专用文字色不必在桌面断言。
- 编译 CSS 可能保留自定义属性冒号后的空格,不能用过于脆弱的完整子串断言判断构建失败。
- 全页截图前将图片 `loading` 改为 `eager` 并等 `decode()`,否则懒加载图片可能空白。
- 等字体加载及欢迎光标标题动画完成再截屏。
- 对已滚动到的生活区域截图时,sticky 页头可能遮住区块标题。可仅在截图样式里隐藏页头,不要为了截图改生产导航行为。
- PowerShell 默认输出编码可能把中文显示成乱码;读取用 `-Encoding utf8`。不要把含中文的 here-string 随意传给 Python 导致源码变成问号。
- Java 源码不要带 UTF-8 BOM;`Set-Content -Encoding utf8` 在某些 PowerShell 版本会加 BOM。可用 `apply_patch` 写入,或通过 `utf-8-sig` 读取后另存 UTF-8。
## 七、构建与后续交付
正常命令:
```powershell
pnpm build
git diff --check
```
构建脚本等价于 `node build.js && theme-package`。`build.js` 会重建 `templates/assets/dist`,主 JS/CSS、像素样式、库和字体均由构建生成。
仅检查中间编译可用:
```powershell
node build.js
```
项目没有通用 `pnpm test`,也没有把历史临时测试脚本提交到仓库。需要重新做模板级验证时,应重建上文的假 Finder 渲染工具或连接明确授权的测试 Halo 实例。
版本规则:
1. 本次保存上下文及其后获授权的 Git 同步,都继续使用现有 3.1.17。
2. 下一次真正完成用户提出的主题修改时才升到 3.1.18。
3. 同一需求只升一次;不要每次验证构建都递增。
4. 用户收到的是 `dist/theme-terminal-witcher-<版本>.zip`。核对 ZIP 中 `theme.yaml` 版本及编译资源,必要时跑 ZIP 完整性检查。
5. 本轮用户已授权提交、打标签、推送并整理现有版本;后续操作按新任务的授权范围执行。Git 仓库发布不表示已经安装到用户网站。
### 本轮实际 Git 目标
- `origin` 为 `https://gitea.witchercheung.cn/witcher/halo_theme_terminal.git`,只有这个配置的远程,默认分支为 `main`。
- 同步前 `main` 指向 `0859e49`,其中 `theme.yaml` 是 3.1.1;本次把现有开发成果集中作为 3.1.17 提交。
- Git 标签采用已有的无 `v` 前缀格式:保留并同步真实的 `3.1.0`、`3.1.1`,新交付标签为 `3.1.17`。
- 不根据聊天版本号伪造 3.1.2–3.1.16 的历史提交或标签。版本开发记录在 `CHANGELOG.md` 和本文件中保留。
- [当前发布页](https://gitea.witchercheung.cn/witcher/halo_theme_terminal/releases/tag/3.1.17) 分发 `theme-terminal-witcher-3.1.17.zip` 与 `SHA256SUMS.txt`;`dist` 继续按原有规则忽略,不将构建产物强行加入 Git 历史。
## 八、这份上下文如何继续使用
- `AGENTS.md` 保留用户原有的两条约定,并指向这两份交接文档。
- 新模型应以实际源码/设置和用户的新消息为准;本文记录的是截至 3.1.17 的状态。
- 目前没有需要它自动继续执行的界面修改。用户要求上下文长期保存在项目 Markdown 中,随后又明确授权将源码、交接文件和现有版本同步到自建 Git 仓库。
- 不依赖 claude-mem 自动注入。此次记忆检索返回 worker 连接错误,未读取到可引用的观察 ID;完整接手依据就是这些文件和工作区。
+40 -6
View File
@@ -3,6 +3,7 @@
一款简洁, 复古的 Terminal 风格 Halo 主题 一款简洁, 复古的 Terminal 风格 Halo 主题
<a href="https://raw.githubusercontent.com/Erzbir/halo-theme-terminal/refs/heads/main/screenshot.png">预览图</a> <a href="https://raw.githubusercontent.com/Erzbir/halo-theme-terminal/refs/heads/main/screenshot.png">预览图</a>
<a href="https://witchercheung.cn">预览网站</a>
## 使用说明 ## 使用说明
@@ -33,6 +34,8 @@
3. 在浅色方案或深色方案中选择 `custom`, 再填写自定义方案的 ID. 3. 在浅色方案或深色方案中选择 `custom`, 再填写自定义方案的 ID.
4. 如需允许访客自由选择配色, 在 `页头 -> 功能按钮` 中保留或添加配色切换按钮. 4. 如需允许访客自由选择配色, 在 `页头 -> 功能按钮` 中保留或添加配色切换按钮.
自定义方案的高级颜色设置支持分别配置 `导航栏背景色` 和 `导航文字颜色`,同时作用于顶部导航、下拉菜单和手机全屏菜单。背景色留空时跟随页面背景,滚动后基于导航栏背景色显示半透明毛玻璃效果。
### 字体与像素风格 ### 字体与像素风格
主题内置 JetBrains Mono, Hack 和 Fira Code, 也可以选择访客的系统字体. 如需加载自己的字体, 开启 `字体与排版 -> 启用自定义字体`, 再按优先级添加字体文件. 主题内置 JetBrains Mono, Hack 和 Fira Code, 也可以选择访客的系统字体. 如需加载自己的字体, 开启 `字体与排版 -> 启用自定义字体`, 再按优先级添加字体文件.
@@ -46,14 +49,36 @@
- `全屏布局` 会让正文占满可用宽度, 并可单独限制正文图片, 视频和 `figure` 的最大宽度 - `全屏布局` 会让正文占满可用宽度, 并可单独限制正文图片, 视频和 `figure` 的最大宽度
- `正文区域最大宽度`, `正文区域内边距` 和 `表格宽度铺满父元素` 用于调整内容区域 - `正文区域最大宽度`, `正文区域内边距` 和 `表格宽度铺满父元素` 用于调整内容区域
- `基础字体大小`, `基础行高` 和 `文章段落间距` 用于调整阅读密度 - `基础字体大小`, `基础行高` 和 `文章段落间距` 用于调整阅读密度
- `无序列表标记`, 边线样式, 边线宽度和标题分隔线用于统一全站视觉风格 - `无序列表标记`, 边线样式, 边线宽度和标题分隔线用于统一全站视觉风格;图片与卡片默认使用方角,主边框默认 2px。在 `全局样式 → 边线宽度(px)` 直接填写 1、1.5、2 等数字,0 隐藏主边框。留空时兼容原有的 `边线宽度(高级 CSS,可选)`,两项都留空时采用默认值
- `元信息分隔符` 用于分隔文章时间, 作者和标签等信息 - `元信息分隔符` 用于分隔文章时间, 作者和标签等信息
### 页面设置 ### 页面设置
首页采用错开的两排布局:上排为 70% 文章和 30% 生活,下排为 30% 阅读和 70% 作品集;窄屏自动变为单列。欢迎区左侧为可配置的个人简介,右侧沿用公告标题、公告内容和终端光标,无外框;标题靠左,公告内容在欢迎区域内靠右。各区域右侧入口统一为“更多”。
在 `主题设置 → 首页` 中配置欢迎区与个人简介:
- `欢迎区样式`:默认细节版,用淡电路走线、轻底色简介和细分隔线组织欢迎区;社交图标与文章归档、作品集快捷入口收在右侧欢迎内容底部。支持切换简洁版。颜色跟随主题,装饰不拦截点击。
- `欢迎区左右比例`:默认左侧名片占 30%、右侧欢迎内容占 70%;也可切换为 50% / 50%。
- 填写 `简介姓名或昵称`、`身份或研究方向` 和 `个人简介`;简介为纯文本,保留换行,文字左对齐。
- `个人照片(可选)`:上传后显示在最右侧,简介位于照片左侧;不上传照片时只显示文字,不留照片占位。也支持仅放照片。
- `关于我或完整简历链接(可选)`:可指向站内页面、外部网址或简历 PDF,不填则不显示链接。
- 手机端先显示名片,再显示欢迎语,简介文字仍在照片左侧。所有简介字段均为空时隐藏简介;关闭 `欢迎区左侧展示个人简介` 可恢复全宽欢迎语。
在 `首页` 设置中维护四个区域:
- `首页文章来源`:默认展示生活分类以外的已发布文章,不会因为模块名为“文章”而自动筛选同名分类;旧版本保存的分类选择也不会自动开启筛选。生活分类(含子分类)优先归入首页生活区,即使文章同时属于技术分类,也不会在两个区域重复出现。排除生活文章后再按设置数量展示,“更多”进入完整归档 `/archives`。如需只展示某一分类,请选择“仅指定分类”,再设置 `首页文章分类`;此时同样排除生活文章,“更多”进入该分类。未找到生活分类时保留原有文章列表。
- 顶层导航中名为“文章”的入口指向 `/archives`,其下嵌入式、机器人、Web 等分类链接仍指向各自分类。导航菜单的缩进用于组织链接,与文章分类管理中的真实父子关系分别维护,不需要为首页展示逐篇移动文章或修改原有分类。
- `文章卡片列数`:自动模式按文章区实际宽度显示两列或三列,手机窄屏一列,也可手动选择两列或三列。`首页文章数量` 默认六篇,适合三列两行或两列三行;已有的自定义数量会保留,可在设置中调整。卡片上方为正方形封面,下方为标题、摘要和日期;无封面时使用终端字符占位。标题最多两行、摘要最多三行,标题提示和文章页保留完整内容。图片框使用方角和主题主边框,鼠标悬停或键盘聚焦提供反馈;减少动态效果模式关闭位移动画。
- `生活文章分类`:选择已有分类,自动读取其中的文章及子分类文章。留空时寻找名为 `生活` 或别名为 `life` 的分类;名称不同时在此明确选择即可,无需调整技术文章的分类。`首页生活文章数量` 控制条数。设置文章封面后,生活列表会显示左侧小封面、右侧标题/日期/摘要;没有封面则采用纯文字布局。
- `阅读书架`:添加书名、封面、一句话点评和可选的阅读笔记链接,每行两本。封面宽度铺满、高度按原图比例自然显示,不裁切、不添加固定比例框造成的上下留白;悬停时不放大裁切书封。通过 `首页书籍数量` 限制首页展示。“更多”默认指向 `/read`,创建别名为 `read` 的独立页面后即可访问;也可通过 `完整书架链接` 改为阅读分类或其它页面地址。
- `首页作品来源`:自动模式读取已启用的项目集插件 `portfolio`,以封面、名称、介绍和开源仓库入口展示作品。插件未启用时使用 `手动作品`;也可直接选择手动模式。GitHub 仓库会显示 GitHub 链接。“更多”默认指向 `/portfolio`,可通过 `完整作品集链接` 修改。
未配置书籍、尚无生活文章或作品时显示简短的空状态。首页沿用主题现有字体、配色、标题分隔线和图片边框;其它页面保持原有布局宽度。
| 页面 | 可配置内容 | | 页面 | 可配置内容 |
|-----|-----------------------------------| |-----|-----------------------------------|
| 首页 | 公告标题, 公告内容, 社交资料, 置顶图标, 图标位置和文章标签 | | 首页 | 公告标题, 公告内容, 个人简介与照片, 社交资料, 置顶图标, 图标位置和文章标签 |
| 文章页 | 文章目录, 目录默认状态和文章标签 | | 文章页 | 文章目录, 目录默认状态和文章标签 |
| 归档页 | 页面标题, 文章标签, 分页和年份展开模式 | | 归档页 | 页面标题, 文章标签, 分页和年份展开模式 |
| 分类页 | 分类列表标题和分类详情标题 | | 分类页 | 分类列表标题和分类详情标题 |
@@ -62,6 +87,8 @@
文章目录会读取正文中的 `h1` 到 `h4`. “自动”模式在普通布局中默认展开, 在全屏布局中默认收起; 目录也会根据浏览器宽度和正文右侧空间调整位置. 文章目录会读取正文中的 `h1` 到 `h4`. “自动”模式在普通布局中默认展开, 在全屏布局中默认收起; 目录也会根据浏览器宽度和正文右侧空间调整位置.
在 `主题设置 → 文章页` 中,`目录边框粗细(px)` 单独控制目录外框,默认 1px,支持小数和 0(隐藏外框)。`目录边框颜色` 留空时,按当前配色自动生成浅色线条,随明暗模式切换;也可选择固定颜色。目录内的层级辅助线沿用这个浅色,整体轮廓更柔和。
### 插件与扩展页面 ### 插件与扩展页面
| 功能 | 使用条件 | | 功能 | 使用条件 |
@@ -141,7 +168,8 @@ html[data-theme-color-scheme='matrix'] {
| `--color-theme-accent-muted` | 中等强度强调色 | | `--color-theme-accent-muted` | 中等强度强调色 |
| `--color-theme-accent-subtle` | 低强度强调色 | | `--color-theme-accent-subtle` | 低强度强调色 |
| `--color-theme-navigation` | 主导航文字 | | `--color-theme-navigation` | 主导航文字 |
| `--color-theme-control` | 页头控件和 Logo | | `--color-theme-navigation-background` | 导航栏、下拉菜单及手机菜单背景 |
| `--color-theme-control` | 页头工具控件 |
| `--color-theme-surface` | 代码块和组件表面 | | `--color-theme-surface` | 代码块和组件表面 |
| `--color-theme-surface-strong` | 对比度更高的代码和控件表面 | | `--color-theme-surface-strong` | 对比度更高的代码和控件表面 |
| `--color-theme-border` | 默认边框 | | `--color-theme-border` | 默认边框 |
@@ -168,7 +196,7 @@ html[data-theme-color-scheme='matrix'] {
| `--content-theme-post-meta-divider` | `"::"` | | `--content-theme-post-meta-divider` | `"::"` |
| `--family-theme-font` | `'JetBrains Mono'` | | `--family-theme-font` | `'JetBrains Mono'` |
| `--list-theme-style` | `disc` | | `--list-theme-style` | `disc` |
| `--width-theme-border` | `calc(var(--size-theme-font) * 0.125)` | | `--width-theme-border` | `2px` |
| `--width-theme-table-border` | `calc(var(--size-theme-font) * 0.0625)` | | `--width-theme-table-border` | `calc(var(--size-theme-font) * 0.0625)` |
| `--width-theme-media-max` | `60%` | | `--width-theme-media-max` | `60%` |
| `--spacing-theme-container-padding` | `calc(var(--size-theme-font) * 2.5)` | | `--spacing-theme-container-padding` | `calc(var(--size-theme-font) * 2.5)` |
@@ -231,7 +259,7 @@ make test
make clean make clean
``` ```
`make test` 会构建主题, 清理旧的测试目录并将压缩包解压到 `dist/theme-terminal-ez` `make test` 会构建主题, 清理旧的测试目录并将压缩包解压到 `dist/theme-terminal-witcher`
### 使用 pnpm ### 使用 pnpm
@@ -244,9 +272,15 @@ pnpm build
构建产物位于: 构建产物位于:
```text ```text
dist/theme-terminal-ez-<version>.zip dist/theme-terminal-witcher-<version>.zip
``` ```
## 版本与源码交接
主题版本以 `theme.yaml` 中的 `spec.version` 为准,当前集中交付版本为 **3.1.17**。对应的 Git 标签为 `3.1.17`,安装包与校验文件见 [3.1.17 发布页](https://gitea.witchercheung.cn/witcher/halo_theme_terminal/releases/tag/3.1.17)。
当前 Git 远程为 [自建仓库](https://gitea.witchercheung.cn/witcher/halo_theme_terminal)。版本变化见 [CHANGELOG.md](CHANGELOG.md);新会话接手先读 [HANDOFF.md](HANDOFF.md) 与 [PROJECT_CONTEXT.md](PROJECT_CONTEXT.md)。
## 原主题 ## 原主题
- [Terminal](https://github.com/wan92hen/theme-terminal) - [Terminal](https://github.com/wan92hen/theme-terminal)
+24
View File
@@ -5,6 +5,8 @@ page.tags.title=Tags
page.tag.title=Tag page.tag.title=Tag
page.categories.title=Categories page.categories.title=Categories
page.category.title=Category page.category.title=Category
page.category.empty=No articles in this category.
page.category.all=View all articles
page.friends.title=Friends page.friends.title=Friends
page.pagination.prev=Prev page.pagination.prev=Prev
page.pagination.next=Next page.pagination.next=Next
@@ -57,3 +59,25 @@ page.links.apply.field.captcha=CAPTCHA
page.links.apply.field.captcha.alt=CAPTCHA page.links.apply.field.captcha.alt=CAPTCHA
page.links.apply.field.captcha.title=Click to refresh CAPTCHA page.links.apply.field.captcha.title=Click to refresh CAPTCHA
page.links.apply.field.captcha.expired=CAPTCHA expired page.links.apply.field.captcha.expired=CAPTCHA expired
header.navigation.open=Open navigation
header.navigation.close=Close navigation
header.navigation.label=Site navigation
header.navigation.submenu=Toggle submenu:
home.notes.title=Articles
home.notes.pinned=Pinned
home.notes.more=More
home.notes.empty=No articles yet.
home.life.title=Life
home.life.more=More
home.life.empty=Life, to be continued.
home.reading.title=Reading
home.reading.more=More
home.reading.empty=A place for books and thoughts.
home.projects.title=Portfolio
home.projects.more=More
home.projects.empty=Projects in progress.
home.profile.title=Profile
home.profile.more=About me
home.profile.photo=Profile photo
home.welcome.links=Explore this blog
home.welcome.articles=Article archive
+24
View File
@@ -5,6 +5,8 @@ page.tags.title=Tags
page.tag.title=Tag page.tag.title=Tag
page.categories.title=Categories page.categories.title=Categories
page.category.title=Category page.category.title=Category
page.category.empty=No articles in this category.
page.category.all=View all articles
page.friends.title=Friends page.friends.title=Friends
page.pagination.prev=Prev page.pagination.prev=Prev
page.pagination.next=Next page.pagination.next=Next
@@ -57,3 +59,25 @@ page.links.apply.field.captcha=CAPTCHA
page.links.apply.field.captcha.alt=CAPTCHA page.links.apply.field.captcha.alt=CAPTCHA
page.links.apply.field.captcha.title=Click to refresh CAPTCHA page.links.apply.field.captcha.title=Click to refresh CAPTCHA
page.links.apply.field.captcha.expired=CAPTCHA expired page.links.apply.field.captcha.expired=CAPTCHA expired
header.navigation.open=Open navigation
header.navigation.close=Close navigation
header.navigation.label=Site navigation
header.navigation.submenu=Toggle submenu:
home.notes.title=Articles
home.notes.pinned=Pinned
home.notes.more=More
home.notes.empty=No articles yet.
home.life.title=Life
home.life.more=More
home.life.empty=Life, to be continued.
home.reading.title=Reading
home.reading.more=More
home.reading.empty=A place for books and thoughts.
home.projects.title=Portfolio
home.projects.more=More
home.projects.empty=Projects in progress.
home.profile.title=Profile
home.profile.more=About me
home.profile.photo=Profile photo
home.welcome.links=Explore this blog
home.welcome.articles=Article archive
+24
View File
@@ -5,6 +5,8 @@ page.tags.title=Etiquetas
page.tag.title=Etiqueta page.tag.title=Etiqueta
page.categories.title=Categorías page.categories.title=Categorías
page.category.title=Categoría page.category.title=Categoría
page.category.empty=No hay artículos en esta categoría.
page.category.all=Ver todos los artículos
page.friends.title=Amigos page.friends.title=Amigos
page.pagination.prev=Anterior page.pagination.prev=Anterior
page.pagination.next=Siguiente page.pagination.next=Siguiente
@@ -57,3 +59,25 @@ page.links.apply.field.captcha=CAPTCHA
page.links.apply.field.captcha.alt=CAPTCHA page.links.apply.field.captcha.alt=CAPTCHA
page.links.apply.field.captcha.title=Haz clic para actualizar el CAPTCHA page.links.apply.field.captcha.title=Haz clic para actualizar el CAPTCHA
page.links.apply.field.captcha.expired=El CAPTCHA ha caducado page.links.apply.field.captcha.expired=El CAPTCHA ha caducado
header.navigation.open=Abrir navegación
header.navigation.close=Cerrar navegación
header.navigation.label=Navegación del sitio
header.navigation.submenu=Mostrar u ocultar submenú:
home.notes.title=Artículos
home.notes.pinned=Fijado
home.notes.more=Más
home.notes.empty=Todavía no hay artículos.
home.life.title=Vida
home.life.more=Más
home.life.empty=La vida, por contar.
home.reading.title=Lecturas
home.reading.more=Más
home.reading.empty=Un espacio para libros e ideas.
home.projects.title=Proyectos
home.projects.more=Más
home.projects.empty=Proyectos en preparación.
home.profile.title=Perfil
home.profile.more=Sobre mí
home.profile.photo=Foto de perfil
home.welcome.links=Explorar el blog
home.welcome.articles=Archivo de artículos
+24
View File
@@ -5,6 +5,8 @@ page.tags.title=标签
page.tag.title=标签 page.tag.title=标签
page.categories.title=分类 page.categories.title=分类
page.category.title=分类 page.category.title=分类
page.category.empty=该分类暂无文章。
page.category.all=查看全部文章
page.friends.title=朋友 page.friends.title=朋友
page.pagination.prev=上一页 page.pagination.prev=上一页
page.pagination.next=下一页 page.pagination.next=下一页
@@ -57,3 +59,25 @@ page.links.apply.field.captcha=验证码
page.links.apply.field.captcha.alt=验证码 page.links.apply.field.captcha.alt=验证码
page.links.apply.field.captcha.title=点击刷新验证码 page.links.apply.field.captcha.title=点击刷新验证码
page.links.apply.field.captcha.expired=验证码已过期 page.links.apply.field.captcha.expired=验证码已过期
header.navigation.open=展开导航
header.navigation.close=关闭导航
header.navigation.label=网站导航
header.navigation.submenu=展开或收起子菜单:
home.notes.title=文章
home.notes.pinned=置顶
home.notes.more=更多
home.notes.empty=还没有文章。
home.life.title=生活
home.life.more=更多
home.life.empty=生活里的点滴,慢慢记录。
home.reading.title=阅读
home.reading.more=更多
home.reading.empty=读过的书,慢慢记在这里。
home.projects.title=作品集
home.projects.more=更多
home.projects.empty=作品整理中。
home.profile.title=个人简介
home.profile.more=关于我
home.profile.photo=个人照片
home.welcome.links=浏览博客
home.welcome.articles=文章归档
+24
View File
@@ -5,6 +5,8 @@ page.tags.title=標籤
page.tag.title=標籤 page.tag.title=標籤
page.categories.title=分類 page.categories.title=分類
page.category.title=分類 page.category.title=分類
page.category.empty=此分類暫無文章。
page.category.all=查看全部文章
page.friends.title=朋友 page.friends.title=朋友
page.pagination.prev=上一頁 page.pagination.prev=上一頁
page.pagination.next=下一頁 page.pagination.next=下一頁
@@ -57,3 +59,25 @@ page.links.apply.field.captcha=驗證碼
page.links.apply.field.captcha.alt=驗證碼 page.links.apply.field.captcha.alt=驗證碼
page.links.apply.field.captcha.title=點擊重新整理驗證碼 page.links.apply.field.captcha.title=點擊重新整理驗證碼
page.links.apply.field.captcha.expired=驗證碼已過期 page.links.apply.field.captcha.expired=驗證碼已過期
header.navigation.open=展開導覽
header.navigation.close=關閉導覽
header.navigation.label=網站導覽
header.navigation.submenu=展開或收合子選單:
home.notes.title=文章
home.notes.pinned=置頂
home.notes.more=更多
home.notes.empty=還沒有文章。
home.life.title=生活
home.life.more=更多
home.life.empty=生活裡的點滴,慢慢記錄。
home.reading.title=閱讀
home.reading.more=更多
home.reading.empty=讀過的書,慢慢記在這裡。
home.projects.title=作品集
home.projects.more=更多
home.projects.empty=作品整理中。
home.profile.title=個人簡介
home.profile.more=關於我
home.profile.photo=個人照片
home.welcome.links=瀏覽部落格
home.welcome.articles=文章歸檔
+271 -5
View File
@@ -1,7 +1,7 @@
apiVersion: v1alpha1 apiVersion: v1alpha1
kind: Setting kind: Setting
metadata: metadata:
name: theme-terminal-ez-setting name: theme-terminal-witcher-setting
spec: spec:
forms: forms:
- group: general - group: general
@@ -525,7 +525,14 @@ spec:
if: "$value.advanced === true" if: "$value.advanced === true"
key: scheme-navigation key: scheme-navigation
name: navigation name: navigation
label: 导航颜色 label: 导航文字颜色
help: 控制导航链接、网站标题及手机菜单按钮的颜色
- $formkit: color
if: "$value.advanced === true"
key: scheme-navigation-background
name: navigation_background
label: 导航栏背景色
help: 留空时跟随页面背景;同时应用于下拉菜单和手机全屏菜单,滚动后保留毛玻璃效果
- $formkit: color - $formkit: color
if: "$value.advanced === true" if: "$value.advanced === true"
key: scheme-control key: scheme-control
@@ -608,12 +615,22 @@ spec:
value: "double" value: "double"
- label: "none" - label: "none"
value: "none" value: "none"
- $formkit: number
label: 边线宽度(px)
name: border_width_px
value:
placeholder: "2"
min: 0
max: 12
step: 0.5
validation: "number|min:0|max:12"
help: 直接填写数字,如 1、1.5、2;控制名片、图片、卡片及菜单等主边框,0 表示隐藏。留空时使用下方高级值,均留空时默认 2px
- $formkit: text - $formkit: text
label: 边线宽度 label: 边线宽度(高级 CSS,可选)
name: border_width name: border_width
value: value:
placeholder: "calc(var(--size-theme-font) * 0.125)" placeholder: "2px"
help: 控制主题通用边线宽度 help: 兼容已有配置,可填写 1px、1.5px 或 calc(...);上方像素数值留空时生效
- $formkit: select - $formkit: select
label: 表格边线样式 label: 表格边线样式
name: table_border_style name: table_border_style
@@ -716,6 +733,16 @@ spec:
- group: index_page - group: index_page
label: 首页 label: 首页
formSchema: formSchema:
- $formkit: select
name: intro_style
label: 欢迎区样式
value: "detailed"
help: 细节版增加淡电路纹理、快捷入口和简介底色;简洁版保留纯文字布局
options:
- label: "细节版"
value: "detailed"
- label: "简洁版"
value: "plain"
- $formkit: text - $formkit: text
name: notice_title name: notice_title
label: 公告标题 label: 公告标题
@@ -725,6 +752,62 @@ spec:
label: 公告内容 label: 公告内容
value: "一款 Terminal 风格的 Halo 主题." value: "一款 Terminal 风格的 Halo 主题."
help: 支持 HTML, 请仅填写可信内容 help: 支持 HTML, 请仅填写可信内容
- $formkit: checkbox
name: profile_enable
id: profile_enable
label: 欢迎区左侧展示个人简介
value: true
help: 开启后欢迎区分为左右两块;关闭后欢迎内容恢复全宽
- $formkit: select
if: "$get(profile_enable).value === true"
key: home-profile-split
name: profile_split
label: 欢迎区左右比例
value: "aligned"
options:
- label: "30% 名片 / 70% 欢迎内容"
value: "aligned"
- label: "50% / 50%(左右等宽)"
value: "equal"
- $formkit: text
if: "$get(profile_enable).value === true"
key: home-profile-name
name: profile_name
label: 简介姓名或昵称
value: ""
- $formkit: text
if: "$get(profile_enable).value === true"
key: home-profile-role
name: profile_role
label: 身份或研究方向
value: ""
- $formkit: textarea
if: "$get(profile_enable).value === true"
key: home-profile-bio
name: profile_bio
label: 个人简介
value: ""
help: 纯文本,支持换行;建议填写简短介绍,完整简历可通过下方链接访问
- $formkit: attachment
if: "$get(profile_enable).value === true"
key: home-profile-photo
name: profile_photo
label: 个人照片(可选)
value: ""
aspectRatio: "4/5"
accepts: ["image/*"]
help: 照片显示在最右侧;留空时仅显示左对齐的简介文字
- $formkit: text
if: "$get(profile_enable).value === true"
key: home-profile-url
name: profile_url
label: 关于我或完整简历链接(可选)
value: ""
placeholder: "/about"
help: 可填写站内页面地址或完整网址,也可链接到简历 PDF;留空时不显示入口
validation:
- - matches
- "/^(https?:\\/\\/|\\/(?!\\/))\\S+$/"
- $formkit: checkbox - $formkit: checkbox
name: show_sns name: show_sns
label: 展示社交资料 label: 展示社交资料
@@ -749,6 +832,170 @@ spec:
value: "left" value: "left"
- label: "above" - label: "above"
value: "above" value: "above"
- $formkit: select
name: article_source
id: article_source
label: 首页文章来源
value: "all"
help: 默认展示生活分类以外的已发布文章,无需移动到名为“文章”的分类;归入生活及其子分类的文章只在首页生活区展示
options:
- label: 全部非生活文章(不限制其他分类)
value: "all"
- label: 仅指定分类
value: "category"
- $formkit: categorySelect
name: note_category
if: "$get(article_source).value === 'category'"
label: 首页文章分类
value: ""
allowCreate: false
help: 仅在主动选择“仅指定分类”后生效;未选择或分类已删除时展示全部非生活文章。即使同时属于所选分类,生活文章也不会重复展示
- $formkit: select
name: article_columns
label: 文章卡片列数
value: "auto"
help: 自动模式根据文章区可用宽度显示两列或三列,手机窄屏为一列
options:
- label: 自动
value: "auto"
- label: 两列
value: "2"
- label: 三列
value: "3"
- $formkit: number
name: note_limit
label: 首页文章数量
value: 6
min: 1
max: 12
validation: "required|number|min:1|max:12"
help: 建议先用六篇,宽屏三列两行或中等宽度两列三行;通过“更多”进入完整分类或归档
- $formkit: categorySelect
name: life_category
label: 生活文章分类
value: ""
allowCreate: false
help: 留空时自动寻找名为生活或别名为 life 的分类;读取该分类及子分类下的文章,并从首页文章区排除。每条生活文章左侧显示其封面,未设封面时仅显示文字
- $formkit: number
name: life_limit
label: 首页生活文章数量
value: 6
min: 1
max: 6
validation: "required|number|min:1|max:6"
- $formkit: number
name: book_limit
label: 首页书籍数量
value: 4
min: 1
max: 12
validation: "required|number|min:1|max:12"
- $formkit: text
name: books_more_url
label: 完整书架链接
value: "/read"
placeholder: "/read"
help: “更多”默认进入 /read;创建别名为 read 的独立页面后即可访问,也可改成阅读分类链接
validation:
- - matches
- "/^(https?:\\/\\/|\\/(?!\\/))\\S+$/"
- $formkit: array
name: books
label: 阅读书架
value: []
max: 24
itemLabels:
- type: image
label: "$value.cover"
- type: text
label: "$value.title"
children:
- $formkit: text
name: title
label: 书名
value: ""
validation: "required"
- $formkit: attachment
name: cover
label: 书籍封面
value: ""
accepts: ["image/*"]
- $formkit: text
name: comment
label: 一句话点评
value: ""
- $formkit: text
name: url
label: 阅读笔记或书籍链接
value: ""
validation:
- - matches
- "/^(https?:\\/\\/|\\/(?!\\/))\\S+$/"
- $formkit: select
name: project_source
label: 首页作品来源
value: "auto"
help: 自动模式优先读取已启用的项目集插件;插件未启用时使用下方手动作品
options:
- label: 自动(优先项目集插件)
value: "auto"
- label: 手动作品
value: "manual"
- $formkit: number
name: project_limit
label: 首页作品数量
value: 4
min: 1
max: 12
validation: "required|number|min:1|max:12"
- $formkit: text
name: projects_more_url
label: 完整作品集链接
value: "/portfolio"
help: “更多”默认进入 /portfolio,也可改为自己的作品集页面链接
validation:
- - matches
- "/^(https?:\\/\\/|\\/(?!\\/))\\S+$/"
- $formkit: array
name: projects
label: 手动作品
value: []
max: 24
itemLabels:
- type: image
label: "$value.cover"
- type: text
label: "$value.title"
children:
- $formkit: text
name: title
label: 作品名称
value: ""
validation: "required"
- $formkit: attachment
name: cover
label: 作品封面
value: ""
aspectRatio: "16/9"
accepts: ["image/*"]
- $formkit: textarea
name: summary
label: 作品介绍
value: ""
- $formkit: text
name: url
label: 作品详情链接
value: ""
validation:
- - matches
- "/^(https?:\\/\\/|\\/(?!\\/))\\S+$/"
- $formkit: text
name: repoUrl
label: GitHub 或其他开源仓库链接
value: ""
validation:
- - matches
- "/^https?:\\/\\/\\S+$/"
- group: post_page - group: post_page
label: 文章页 label: 文章页
formSchema: formSchema:
@@ -761,6 +1008,25 @@ spec:
id: show_toc id: show_toc
label: 显示文章目录 label: 显示文章目录
value: true value: true
- $formkit: number
if: "$get(show_toc).value === true"
key: toc-border-width
name: toc_border_width_px
label: 目录边框粗细(px)
value: 1
placeholder: "1"
min: 0
max: 6
step: 0.5
validation: "number|min:0|max:6"
help: 单独控制右侧文章目录的外边框,支持 0.5、1、1.5 等数值;0 隐藏外边框,留空默认 1px
- $formkit: color
if: "$get(show_toc).value === true"
key: toc-border-color
name: toc_border_color
label: 目录边框颜色
value: ""
help: 留空时自动使用当前配色的浅色边框,随浅色和深色模式切换;也可自行选择固定颜色
- $formkit: select - $formkit: select
if: "$get(show_toc).value === true" if: "$get(show_toc).value === true"
key: toc-default-open key: toc-default-open
+2
View File
@@ -1,6 +1,8 @@
import {terminal} from "../terminal.js"; import {terminal} from "../terminal.js";
import {registerColorSchemePicker} from "./color-scheme-picker.js"; import {registerColorSchemePicker} from "./color-scheme-picker.js";
import {registerHeaderActions} from "./header-actions.js"; import {registerHeaderActions} from "./header-actions.js";
import {registerNavigation} from "./navigation.js";
terminal.registerInitFunc(registerNavigation);
terminal.registerInitFunc(registerHeaderActions); terminal.registerInitFunc(registerHeaderActions);
terminal.registerInitFunc(registerColorSchemePicker); terminal.registerInitFunc(registerColorSchemePicker);
+122
View File
@@ -0,0 +1,122 @@
export function registerNavigation() {
const header = document.querySelector(".header");
if (!header) return;
function syncScrolledHeader() {
header.classList.toggle("is-scrolled", window.scrollY > 8);
}
window.addEventListener("scroll", syncScrolledHeader, {passive: true});
window.addEventListener("pageshow", syncScrolledHeader);
syncScrolledHeader();
const navigation = document.getElementById("site-navigation");
const toggle = header?.querySelector(".navigation-toggle");
if (!navigation || !toggle) return;
// Keep this breakpoint in sync with $navigation-mobile-width.
const mobile = window.matchMedia("(max-width: 899px)");
const root = document.documentElement;
const menus = [...navigation.querySelectorAll(".menu")];
const background = [...document.querySelectorAll(".wrapper > .container, .wrapper > .footer")];
const previousInert = new Map();
let open = false;
function setSubmenu(menu, expanded) {
menu.classList.toggle("is-open", expanded);
menu.querySelector(".menu-trigger")?.setAttribute("aria-expanded", String(expanded));
}
function closeSubmenus() {
menus.forEach(menu => setSubmenu(menu, false));
}
function setOpen(expanded, restoreFocus = true) {
const wasOpen = open;
open = mobile.matches && expanded;
root.classList.toggle("navigation-open", open);
toggle.setAttribute("aria-expanded", String(open));
toggle.setAttribute("aria-label", open ? toggle.dataset.labelClose : toggle.dataset.labelOpen);
navigation.inert = mobile.matches && !open;
if (navigation.inert) navigation.setAttribute("aria-hidden", "true");
else navigation.removeAttribute("aria-hidden");
if (open) {
toggle.focus({preventScroll: true});
header.setAttribute("role", "dialog");
header.setAttribute("aria-modal", "true");
header.setAttribute("aria-label", navigation.getAttribute("aria-label"));
background.forEach(element => {
if (!previousInert.has(element)) previousInert.set(element, element.inert);
element.inert = true;
});
} else {
header.removeAttribute("role");
header.removeAttribute("aria-modal");
header.removeAttribute("aria-label");
previousInert.forEach((inert, element) => { element.inert = inert; });
previousInert.clear();
closeSubmenus();
if (wasOpen && restoreFocus) toggle.focus({preventScroll: true});
}
}
toggle.addEventListener("click", () => setOpen(!open));
header.addEventListener("click", event => {
if (event.target.closest("a[href]")) {
setOpen(false);
closeSubmenus();
}
});
menus.forEach(menu => {
const trigger = menu.querySelector(".menu-trigger");
menu.addEventListener("pointerenter", event => {
if (!mobile.matches && event.pointerType !== "touch") setSubmenu(menu, true);
});
menu.addEventListener("pointerleave", () => {
if (!menu.contains(document.activeElement)) setSubmenu(menu, false);
});
menu.addEventListener("focusin", event => {
if (!mobile.matches && event.target !== trigger) setSubmenu(menu, true);
});
menu.addEventListener("focusout", event => {
if (!menu.contains(event.relatedTarget)) setSubmenu(menu, false);
});
trigger?.addEventListener("click", () => {
setSubmenu(menu, !menu.classList.contains("is-open"));
});
});
document.addEventListener("keydown", event => {
if (event.key === "Escape") {
if (open) {
event.preventDefault();
setOpen(false);
} else {
const activeMenu = menus.find(menu => menu.classList.contains("is-open"));
if (activeMenu) {
activeMenu.querySelector(".menu-trigger")?.focus({preventScroll: true});
closeSubmenus();
}
}
}
if (!open || event.key !== "Tab") return;
const focusable = [...header.querySelectorAll("a[href], button")]
.filter(element => !element.disabled && element.getClientRects().length && !element.closest("[inert]"));
const first = focusable[0];
const last = focusable[focusable.length - 1];
if (event.shiftKey && document.activeElement === first) {
event.preventDefault();
last?.focus({preventScroll: true});
} else if (!event.shiftKey && document.activeElement === last) {
event.preventDefault();
first?.focus({preventScroll: true});
}
});
mobile.addEventListener("change", () => setOpen(false));
document.addEventListener("pjax:send", () => setOpen(false, false));
window.addEventListener("pageshow", () => setOpen(false, false));
setOpen(false, false);
}
+179 -100
View File
@@ -1,119 +1,198 @@
.header { @use "variables" as *;
display: flex;
flex-direction: column;
position: relative;
&-inner { :root {
--height-theme-header: 64px;
}
.header {
position: sticky;
top: 0;
z-index: 1100;
flex: 0 0 auto;
// Blur a separate layer so fixed mobile navigation stays relative to the viewport.
&::before {
content: "";
position: absolute;
inset: 0;
z-index: 0;
background: var(--color-theme-navigation-background);
box-shadow: none;
pointer-events: none;
transition: background-color 160ms ease, box-shadow 160ms ease;
}
&.is-scrolled::before {
box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--color-theme-navigation) 16%, transparent);
}
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
.header.is-scrolled::before {
background: color-mix(in srgb, var(--color-theme-navigation-background) 72%, transparent);
-webkit-backdrop-filter: blur(14px) saturate(140%);
backdrop-filter: blur(14px) saturate(140%);
}
}
.header-container {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 32px;
width: 100%;
max-width: 1200px;
min-height: var(--height-theme-header);
margin: 0 auto;
padding: 8px 32px;
}
.color-scheme-picker { .header-brand {
position: relative; position: relative;
display: flex; z-index: 3;
display: inline-flex;
align-items: center; align-items: center;
flex: 0 0 auto; flex: 0 1 auto;
width: max-content; gap: 12px;
margin-left: calc(var(--size-theme-font) * 0.5);
}
.color-scheme-trigger {
transition: none;
animation: none;
}
.color-scheme-menu {
position: absolute;
z-index: 20;
top: calc(100% + var(--width-theme-border));
right: 0;
display: block;
width: max-content;
min-width: 100%;
max-height: calc(var(--size-theme-font) * 12);
overflow-y: auto;
margin: 0;
padding: 0;
background: var(--color-theme-background);
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-control);
&[hidden] {
display: none;
}
}
.color-scheme-option {
display: block;
width: 100%;
margin: 0;
padding: calc(var(--size-theme-font) * 0.35) calc(var(--size-theme-font) * 0.4);
color: var(--color-theme-control);
background: var(--color-theme-background);
border: 0;
border-bottom: calc(var(--width-theme-border) / 2) var(--style-theme-border) var(--color-theme-control);
border-radius: 0;
font-size: calc(var(--size-theme-font) * 0.8);
font-weight: 500;
text-align: left;
white-space: nowrap;
transition: none;
animation: none;
&:last-child {
border-bottom: 0;
}
&:focus-visible,
&[aria-selected="true"] {
color: var(--color-theme-text-inverse);
background: var(--color-theme-control);
outline: none;
}
}
.color-scheme-trigger,
.header-action-button {
background-color: transparent;
color: var(--color-theme-control);
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-control);
margin: 0;
padding: 0;
}
.header-action-button {
margin-left: calc(var(--size-theme-font) * 0.5);
}
}
&-logo {
display: flex;
flex: 1;
min-width: 0; min-width: 0;
max-width: 40%;
color: var(--color-theme-navigation);
text-decoration: none;
}
&::after { .header-brand-logo,
content: ""; .header-brand-fallback {
background: repeating-linear-gradient(135deg, var(--color-theme-control), var(--color-theme-control) var(--width-theme-border), transparent 0, transparent calc(var(--size-theme-font) * 0.625)); flex: 0 0 auto;
display: block; width: 36px;
width: 100%; height: 36px;
right: calc(var(--size-theme-font) * 0.996); margin: 0;
padding: 0;
border-radius: var(--radius-theme-border);
}
.header-brand-logo {
border: 0;
object-fit: contain;
}
.header-brand-fallback {
display: grid;
place-items: center;
border: var(--width-theme-border) var(--style-theme-border) currentColor;
font-size: 18px;
font-weight: 600;
line-height: 1;
}
.header-brand-title {
overflow: hidden;
font-size: calc(var(--size-theme-font) * 1.125);
font-weight: 600;
line-height: 1.4;
text-overflow: ellipsis;
white-space: nowrap;
}
.navigation-toggle {
display: none;
}
@media (max-width: $navigation-mobile-width) {
:root {
--height-theme-header: 56px;
} }
a { html.navigation-open {
overflow: hidden;
overscroll-behavior: none;
}
.header-container {
gap: 16px;
min-height: calc(var(--height-theme-header) + env(safe-area-inset-top, 0px));
padding: calc(6px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 6px max(20px, env(safe-area-inset-left, 0px));
&::before {
content: "";
position: absolute;
inset: 0;
z-index: 2;
background: transparent;
pointer-events: none;
}
}
.navigation-open .header-container::before {
background: var(--color-theme-navigation-background);
}
.header-brand {
gap: 10px;
max-width: calc(100% - 60px);
}
.header-brand-logo,
.header-brand-fallback {
width: 32px;
height: 32px;
}
.header-brand-title {
font-size: calc(var(--size-theme-font) * 1.0625);
}
.navigation-toggle {
z-index: 3;
display: flex;
flex: 0 0 auto; flex: 0 0 auto;
max-width: 100%; flex-direction: column;
text-decoration: none; align-items: center;
justify-content: center;
gap: 5px;
width: 44px;
height: 44px;
margin: 0 0 0 auto;
padding: 10px;
color: var(--color-theme-navigation);
background: transparent;
border: 0;
border-radius: var(--radius-theme-border);
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
> span {
display: block;
width: 24px;
height: 2px;
flex: 0 0 auto;
background: currentColor;
transform-origin: center;
transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}
&[aria-expanded="true"] {
> span:nth-child(1) {
transform: translateY(7px) rotate(45deg);
}
> span:nth-child(2) {
opacity: 0;
transform: scaleX(0);
}
> span:nth-child(3) {
transform: translateY(-7px) rotate(-45deg);
}
} }
} }
} }
.logo { @media (prefers-reduced-motion: reduce) {
display: flex; .header::before,
align-items: center; .navigation-toggle > span {
text-decoration: none; transition: none;
background: var(--color-theme-control); }
color: var(--color-theme-text-inverse);
font-weight: 500;
padding: calc(var(--size-theme-font) * 0.3125) calc(var(--size-theme-font) * 0.625);
} }
@media print { @media print {
+708
View File
@@ -0,0 +1,708 @@
@use "variables" as *;
// The content marker also updates these rules after PJAX replaces the homepage.
.container:has(> .content > .homepage) {
width: 100%;
max-width: 1440px;
}
body:has(.homepage) .header-container {
max-width: 1440px;
padding-inline: var(--spacing-theme-container-padding);
}
body[data-layout-mode="fullscreen"] .homepage :is(.home-profile-photo, .home-book-cover img, .home-project-cover img, .home-article-cover img, .home-life-cover img) {
max-width: 100%;
margin: 0;
}
.homepage {
--radius-home-image: var(--radius-theme-border);
width: 100%;
min-width: 0;
.home-intro {
display: grid;
grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
align-items: center;
gap: calc(var(--size-theme-font) * 2.25);
margin: 0 0 calc(var(--size-theme-font) * 1.5);
padding: calc(var(--size-theme-font) * 0.75) 0;
&[data-split="equal"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
&[data-split="single"] {
grid-template-columns: minmax(0, 1fr);
.home-welcome { grid-column: 1; }
}
}
.home-welcome {
grid-column: 2;
min-width: 0;
margin: 0;
padding: 0;
border: 0;
h1 {
margin: 0 0 calc(var(--size-theme-font) * 1.5);
text-align: left;
}
}
.home-welcome-description {
text-align: right;
text-wrap: pretty;
overflow-wrap: anywhere;
> :first-child { margin-top: 0; }
> :last-child { margin-bottom: 0; }
}
.home-welcome-art { display: none; }
.home-welcome-footer {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: calc(var(--size-theme-font) * 0.75);
margin-top: var(--size-theme-font);
.home-social { margin: 0; }
.sns-container { padding: 0; }
.sns-icon { min-width: 36px; min-height: 36px; }
}
.home-welcome-links {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: calc(var(--size-theme-font) * 0.5);
margin-left: auto;
a {
display: inline-flex;
align-items: center;
gap: calc(var(--size-theme-font) * 0.5);
min-height: 36px;
padding: calc(var(--size-theme-font) * 0.25) calc(var(--size-theme-font) * 0.625);
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-theme-border);
color: var(--color-theme-text);
font-size: calc(var(--size-theme-font) * 0.8);
transition: background-color 160ms ease, border-color 160ms ease;
&:hover {
background: var(--color-theme-surface);
border-color: var(--color-theme-border-accent);
}
&:focus-visible {
outline: 2px solid var(--color-theme-border-accent);
outline-offset: 3px;
}
}
svg {
width: 1em;
height: 1em;
fill: none;
stroke: currentColor;
stroke-width: 1.25;
stroke-linecap: round;
stroke-linejoin: round;
}
}
.home-profile {
grid-column: 1;
display: flex;
align-items: flex-start;
justify-content: flex-end;
gap: var(--size-theme-font);
min-width: 0;
padding: var(--size-theme-font);
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-home-image);
}
.home-profile-copy {
flex: 1;
min-width: 0;
max-width: 28ch;
text-align: left;
overflow-wrap: anywhere;
}
.home-profile-name {
margin: 0;
color: var(--color-theme-text-accent);
font-size: calc(var(--size-theme-font) * 1.1);
font-weight: 500;
line-height: 1.5;
}
.home-profile-role {
margin: calc(var(--size-theme-font) * 0.25) 0 0;
color: var(--color-theme-text-secondary);
font-size: calc(var(--size-theme-font) * 0.85);
line-height: 1.6;
}
.home-profile-bio {
margin: calc(var(--size-theme-font) * 0.5) 0 0;
color: var(--color-theme-text);
font-size: calc(var(--size-theme-font) * 0.9);
line-height: 1.75;
white-space: pre-line;
}
.home-profile-link {
display: inline-block;
margin-top: calc(var(--size-theme-font) * 0.5);
color: var(--color-theme-text-link);
font-size: calc(var(--size-theme-font) * 0.85);
}
.home-profile-photo {
display: block;
flex: 0 0 auto;
width: clamp(80px, 7vw, 112px);
height: auto;
aspect-ratio: 4 / 5;
object-fit: cover;
margin: 0;
padding: 0;
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-home-image);
}
.home-social {
margin-bottom: calc(var(--size-theme-font) * 1.25);
}
.home-row {
display: grid;
align-items: start;
gap: calc(var(--size-theme-font) * 2.25);
&--top {
grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
align-items: stretch;
}
&--bottom {
grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
margin-top: calc(var(--size-theme-font) * 3);
}
}
.home-section {
min-width: 0;
}
.home-section-heading {
flex: 0 0 auto;
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 1ch;
margin-bottom: calc(var(--size-theme-font) * 1.25);
padding-bottom: calc(var(--size-theme-font) * 0.625);
border-bottom: var(--width-theme-border) var(--style-theme-title-divider) var(--color-theme-border-accent);
h2 {
margin: 0;
color: var(--color-theme-text-accent);
font-size: calc(var(--size-theme-font) * 1.4);
font-weight: 400;
}
}
.home-more {
flex: 0 0 auto;
color: var(--color-theme-text-link);
font-size: calc(var(--size-theme-font) * 0.85);
}
.home-empty {
margin: 0;
padding: calc(var(--size-theme-font) * 0.75) 0;
color: var(--color-theme-text-secondary);
}
.home-notes {
container: home-articles / inline-size;
}
.home-notes,
.home-life {
display: flex;
flex-direction: column;
}
.home-note-list {
display: grid;
flex: 1;
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-auto-rows: 1fr;
gap: calc(var(--size-theme-font) * 1.25);
&[data-columns="3"] {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.home-article-card {
display: flex;
min-width: 0;
overflow: hidden;
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-home-image);
background: var(--color-theme-background);
transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.home-article-link {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
color: var(--color-theme-text);
text-decoration: none;
&:focus-visible {
outline: 2px solid var(--color-theme-accent);
outline-offset: -3px;
border-radius: inherit;
}
}
.home-article-cover {
position: relative;
display: grid;
flex: 0 0 auto;
place-items: center;
aspect-ratio: 1;
overflow: hidden;
background: var(--color-theme-surface);
img {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
object-fit: cover;
transition: transform 350ms ease;
}
}
.home-article-placeholder {
color: var(--color-theme-text-muted);
font-size: calc(var(--size-theme-font) * 3);
user-select: none;
}
.home-article-pin {
position: absolute;
top: 10px;
right: 10px;
padding: 2px 6px;
border-radius: var(--radius-theme-border);
color: var(--color-theme-text);
background: var(--color-theme-background);
font-size: calc(var(--size-theme-font) * 0.75);
}
.home-article-content {
display: flex;
flex: 1;
flex-direction: column;
gap: calc(var(--size-theme-font) * 0.625);
min-width: 0;
padding: calc(var(--size-theme-font) * 0.875);
}
.home-article-title {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
min-height: 3em;
max-height: 3em;
margin: 0;
color: var(--color-theme-text-accent);
font-size: calc(var(--size-theme-font) * 1.125);
font-weight: 400;
line-height: 1.5;
overflow-wrap: anywhere;
}
.home-article-excerpt {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
min-height: 4.8em;
max-height: 4.8em;
margin: 0;
color: var(--color-theme-text-secondary);
font-size: calc(var(--size-theme-font) * 0.9);
line-height: 1.6;
overflow-wrap: anywhere;
}
.home-article-date {
margin-top: auto;
color: var(--color-theme-text-muted);
font-size: calc(var(--size-theme-font) * 0.8);
line-height: 1.5;
}
.home-article-tags {
overflow: hidden;
min-height: 1.5em;
color: var(--color-theme-text-label);
font-size: calc(var(--size-theme-font) * 0.75);
line-height: 1.5;
text-overflow: ellipsis;
white-space: nowrap;
span + span { margin-left: 1ch; }
}
.home-life-list {
display: flex;
flex: 1;
flex-direction: column;
}
.home-summary {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
overflow-wrap: anywhere;
}
.home-life-post {
display: flex;
align-items: flex-start;
gap: calc(var(--size-theme-font) * 0.75);
flex: 1;
padding-bottom: calc(var(--size-theme-font) * 1.25);
&:last-child {
flex: 0 0 auto;
padding-bottom: 0;
}
+ .home-life-post {
padding-top: calc(var(--size-theme-font) * 1.25);
border-top: calc(var(--width-theme-border) / 2) var(--style-theme-border) var(--color-theme-border-muted);
}
h3 {
margin: 0 0 calc(var(--size-theme-font) * 0.4);
font-size: calc(var(--size-theme-font) * 1.1);
font-weight: 400;
line-height: 1.5;
a {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
color: var(--color-theme-text-accent);
}
}
.home-summary { margin: calc(var(--size-theme-font) * 0.5) 0 0; }
}
.home-life-copy {
flex: 1;
min-width: 0;
overflow-wrap: anywhere;
}
.home-life-cover {
display: block;
flex: 0 0 clamp(64px, 5vw, 88px);
aspect-ratio: 1;
overflow: hidden;
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-theme-border);
img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
}
&:focus-visible {
outline: 2px solid var(--color-theme-border-accent);
outline-offset: 3px;
}
}
.home-book-grid,
.home-project-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: calc(var(--size-theme-font) * 1.5) calc(var(--size-theme-font) * 1.25);
}
.home-book,
.home-project {
min-width: 0;
}
.home-book-cover,
.home-project-cover {
display: block;
overflow: hidden;
margin-bottom: calc(var(--size-theme-font) * 0.625);
border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-home-image);
background: var(--color-theme-surface);
transition: border-color 200ms ease;
img {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
transition: transform 350ms ease;
}
}
.home-book-cover {
background: transparent;
img {
height: auto;
aspect-ratio: auto;
object-fit: contain;
}
}
.home-project-cover { aspect-ratio: 16 / 9; }
.home-book-placeholder {
aspect-ratio: 2 / 3;
object-fit: contain;
}
.home-book-placeholder {
display: grid;
place-items: center;
padding: calc(var(--size-theme-font) * 0.75);
width: 100%;
height: 100%;
color: var(--color-theme-text);
background: var(--color-theme-surface);
text-align: center;
}
.home-book-title {
margin: 0;
font-size: var(--size-theme-font);
font-weight: 400;
}
.home-book-comment {
overflow: hidden;
margin: calc(var(--size-theme-font) * 0.25) 0 0;
color: var(--color-theme-text-secondary);
font-size: calc(var(--size-theme-font) * 0.9);
text-overflow: ellipsis;
white-space: nowrap;
}
.home-project {
display: flex;
flex-direction: column;
.home-summary {
margin: 0 0 calc(var(--size-theme-font) * 0.75);
font-size: calc(var(--size-theme-font) * 0.95);
}
}
.home-project-cover img {
aspect-ratio: 16 / 9;
object-fit: cover;
}
.home-project-title {
margin: 0 0 calc(var(--size-theme-font) * 0.75);
padding-bottom: calc(var(--size-theme-font) * 0.625);
font-size: calc(var(--size-theme-font) * 1.15);
}
.home-repository {
display: inline-flex;
align-items: center;
align-self: start;
gap: 0.5ch;
margin-top: auto;
color: var(--color-theme-text-link);
font-size: calc(var(--size-theme-font) * 0.9);
svg { width: 1.2em; height: 1.2em; }
}
}
.homepage[data-intro-style="detailed"] {
.home-intro {
align-items: stretch;
margin-bottom: calc(var(--size-theme-font) * 2);
}
.home-welcome {
position: relative;
isolation: isolate;
display: flex;
flex-direction: column;
justify-content: center;
min-height: calc(var(--size-theme-font) * 11.5);
padding-top: calc(var(--size-theme-font) * 0.75);
h1,
.home-welcome-description,
.home-welcome-footer { position: relative; }
h1 { margin-bottom: calc(var(--size-theme-font) * 1.25); }
}
.home-welcome-art {
display: block;
position: absolute;
right: 0;
top: 0;
z-index: -1;
width: min(42%, 360px);
height: auto;
color: var(--color-theme-text);
opacity: 0.085;
pointer-events: none;
}
.home-welcome-description {
max-width: 68ch;
margin-left: auto;
}
.home-welcome-footer {
margin-top: calc(var(--size-theme-font) * 1.5);
padding-top: calc(var(--size-theme-font) * 0.625);
border-top: 1px solid var(--color-theme-border-muted);
}
.home-profile {
position: relative;
align-items: center;
background: color-mix(in srgb, var(--color-theme-text) 3%, var(--color-theme-background));
&:not(:has(.home-profile-copy)) {
background: none;
}
}
.home-profile-copy { max-width: none; }
.home-profile-name { font-weight: 600; }
.home-profile-photo {
box-shadow: 4px 4px 0 color-mix(in srgb, var(--color-theme-text) 5%, transparent);
}
}
@container home-articles (min-width: 800px) {
.homepage .home-note-list:not([data-columns="2"]) {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@container home-articles (max-width: 420px) {
.homepage .home-note-list[data-columns] {
grid-template-columns: minmax(0, 1fr);
}
}
@media (hover: hover) and (pointer: fine) {
.homepage .home-article-card:hover {
transform: translateY(-4px);
border-color: var(--color-theme-border-accent);
box-shadow: 0 6px 16px color-mix(in srgb, var(--color-theme-text) 8%, transparent);
.home-article-cover img { transform: scale(1.035); }
}
.homepage .home-book-cover:hover {
border-color: var(--color-theme-border-accent);
}
.homepage .home-project-cover:hover {
border-color: var(--color-theme-border-accent);
img { transform: scale(1.035); }
}
}
.homepage .home-article-card:focus-within {
transform: translateY(-4px);
border-color: var(--color-theme-border-accent);
}
@media (prefers-reduced-motion: reduce) {
.homepage .home-article-card,
.homepage .home-article-cover img,
.homepage .home-book-cover,
.homepage .home-book-cover img,
.homepage .home-project-cover,
.homepage .home-project-cover img {
transition: none;
transform: none !important;
}
}
@media (max-width: $tablet-max-width) {
.homepage .home-intro[data-split] {
grid-template-columns: minmax(0, 1fr);
gap: calc(var(--size-theme-font) * 1.5);
}
.homepage .home-profile,
.homepage .home-welcome {
grid-column: 1;
}
.homepage .home-row {
grid-template-columns: minmax(0, 1fr);
gap: calc(var(--size-theme-font) * 2.5);
}
}
@media (max-width: 768px) {
body:has(.homepage) .header-container {
padding-inline: var(--spacing-theme-container-padding-mobile);
}
}
@media (max-width: $phone-max-width) {
.homepage {
.home-project-grid { grid-template-columns: minmax(0, 1fr); }
.home-welcome h1 { margin-bottom: var(--size-theme-font); }
}
}
+2 -2
View File
@@ -15,7 +15,7 @@
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--width-theme-scrollbar: thin; --width-theme-scrollbar: thin;
--lig-theme-font: none; --lig-theme-font: none;
--width-theme-border: calc(var(--size-theme-font) * 0.125); --width-theme-border: 2px;
--width-theme-table-border: calc(var(--size-theme-font) * 0.0625); --width-theme-table-border: calc(var(--size-theme-font) * 0.0625);
--width-theme-media-max: 60%; --width-theme-media-max: 60%;
--spacing-theme-container-padding: calc(var(--size-theme-font) * 2.5); --spacing-theme-container-padding: calc(var(--size-theme-font) * 2.5);
@@ -379,7 +379,7 @@ kbd {
border-left: calc(var(--width-theme-border) / 2) solid var(--color-theme-border-accent); border-left: calc(var(--width-theme-border) / 2) solid var(--color-theme-border-accent);
border-right: calc(var(--width-theme-border) / 2) solid var(--color-theme-border-accent); border-right: calc(var(--width-theme-border) / 2) solid var(--color-theme-border-accent);
border-bottom: calc(var(--width-theme-border) * 2) solid var(--color-theme-border-accent); border-bottom: calc(var(--width-theme-border) * 2) solid var(--color-theme-border-accent);
border-radius: calc(var(--size-theme-font) * 0.25); border-radius: var(--radius-theme-border);
} }
code code { code code {
+158 -94
View File
@@ -1,143 +1,207 @@
@use "variables" as *; @use "variables" as *;
.navigation-menu { .navigation-menu {
display: flex; min-width: 0;
align-items: flex-start; margin-left: auto;
justify-content: space-between; color: var(--color-theme-navigation);
margin: calc(var(--size-theme-font) * 1.25) calc(var(--size-theme-font) * 0.0625); font-size: var(--size-theme-font);
a { a {
color: inherit;
text-decoration: none; text-decoration: none;
color: var(--color-theme-navigation);
}
@media (max-width: $phone-max-width) {
margin: 0;
} }
&-inner { &-inner {
display: flex; display: flex;
flex: 1;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: 8px clamp(16px, 1.5vw, 24px);
margin: 0;
padding: 0;
list-style: none; list-style: none;
margin: 0;
padding: 0;
@media (max-width: $phone-max-width) {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(calc(var(--size-theme-font) * 7.5), 1fr));
gap: calc(var(--size-theme-font) * 0.625);
align-items: start;
justify-items: center;
padding: 0;
> li {
width: 100%;
margin: 0;
padding: 0;
}
> li a {
display: block;
text-align: left;
white-space: normal;
overflow-wrap: anywhere;
word-break: break-word;
}
}
> li { > li {
flex: 0 0 auto; flex: 0 0 auto;
margin-bottom: calc(var(--size-theme-font) * 0.625);
white-space: nowrap;
@media (max-width: $phone-max-width) {
margin: 0; margin: 0;
padding: calc(var(--size-theme-font) * 0.3125); padding: 0;
min-width: 0; white-space: nowrap;
white-space: normal;
} }
&:not(:last-of-type) { > li > div > a,
margin-right: calc(var(--size-theme-font) * 1.25); .menu-wrapper > a {
display: block;
@media (max-width: $phone-max-width) { padding: 8px 0;
margin-right: 0;
}
}
} }
} }
.menu { .menu {
display: flex;
position: relative; position: relative;
list-style: none; margin: 0 0 -6px;
padding: 0; padding: 0 0 6px;
margin: 0;
@media (max-width: $phone-max-width) {
max-width: 100%;
}
}
.menu > a {
@media (max-width: $phone-max-width) {
min-width: 0;
}
} }
.menu-wrapper { .menu-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; gap: 4px;
> a {
text-decoration: none;
color: var(--color-theme-navigation);
}
} }
.menu-trigger { .menu-trigger {
cursor: pointer; flex: 0 0 auto;
background-color: var(--color-theme-background); width: 12px;
margin-left: calc(var(--size-theme-font) * 0.3125); height: 32px;
color: var(--color-theme-navigation); margin: 0;
user-select: none; padding: 0;
border: 0;
border-radius: var(--radius-theme-border);
background: transparent;
color: inherit;
font-size: 12px;
font-weight: normal;
line-height: 1;
}
.menu-chevron {
display: block;
width: 12px;
height: 12px;
opacity: 0.65;
transition: transform 160ms ease, opacity 160ms ease;
}
.menu.is-open .menu-chevron {
opacity: 1;
transform: rotate(180deg);
} }
.menu-dropdown { .menu-dropdown {
position: absolute;
top: 100%;
right: 0;
z-index: 1;
display: none; display: none;
flex-direction: column; flex-direction: column;
position: absolute; min-width: 160px;
background: var(--color-theme-background); width: max-content;
color: var(--color-theme-text-accent); max-width: min(320px, calc(100vw - 40px));
border: calc(var(--size-theme-font) * 0.125) solid var(--color-theme-navigation); max-height: 60vh;
overflow-y: auto;
margin: 0; margin: 0;
padding: calc(var(--size-theme-font) * 0.3125); padding: 5px;
top: calc(var(--size-theme-font) * 1.5625); border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-navigation);
border-radius: var(--radius-theme-border);
background: var(--color-theme-navigation-background);
list-style: none; list-style: none;
z-index: 99;
@media (max-width: $phone-max-width) { > li {
left: auto; margin: 0;
right: 0; padding: 0;
}
a {
display: block;
padding: 7px 10px;
border-radius: var(--radius-theme-border);
white-space: normal;
&:hover,
&:focus-visible {
background: var(--color-theme-navigation);
color: var(--color-theme-navigation-background);
}
} }
} }
.menu-dropdown > li { .menu.is-open .menu-dropdown {
flex: 0 0 auto;
}
.menu-dropdown > li a {
display: flex; display: flex;
padding: calc(var(--size-theme-font) * 0.3125);
text-decoration: none;
} }
}
.menu:hover .menu-dropdown, @media (max-width: $navigation-mobile-width) {
.menu:active .menu-dropdown { .navigation-menu {
position: fixed;
inset: 0;
z-index: 1;
width: 100%;
height: 100vh;
height: 100dvh;
overflow-y: auto;
overscroll-behavior: contain;
margin: 0;
padding: calc(var(--height-theme-header) + env(safe-area-inset-top, 0px) + 28px) max(24px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
background: var(--color-theme-navigation-background);
visibility: hidden;
pointer-events: none;
transform: translateX(100%);
transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 240ms;
&-inner {
flex-direction: column;
align-items: stretch;
gap: 18px;
text-align: left;
> li {
width: 100%;
white-space: normal;
}
> li > div > a,
.menu-wrapper > a {
padding: 5px 0;
font-size: calc(var(--size-theme-font) * 1.625);
font-weight: 500;
line-height: 1.5;
}
}
.menu {
margin: 0;
padding: 0;
}
.menu-wrapper {
justify-content: flex-start;
}
.menu-trigger {
display: none;
}
.menu-dropdown {
position: static;
display: flex; display: flex;
opacity: 1; align-items: stretch;
gap: 3px;
min-width: 0;
width: auto;
max-width: none;
max-height: none;
overflow: visible;
padding: 4px 0 0 2em;
border: 0;
background: transparent;
color: inherit;
font-size: var(--size-theme-font);
text-align: left;
a {
padding: 6px 0;
}
}
}
.navigation-open .navigation-menu {
visibility: visible; visibility: visible;
pointer-events: auto;
transform: translateX(0);
}
}
@media (prefers-reduced-motion: reduce) {
.navigation-menu,
.navigation-menu .menu-chevron {
transition: none;
} }
} }
+2 -1
View File
@@ -8,7 +8,8 @@
width: 100%; width: 100%;
height: calc(var(--size-theme-font) * 12.5); height: calc(var(--size-theme-font) * 12.5);
object-fit: cover; object-fit: cover;
border-radius: var(--size-theme-font); border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
border-radius: var(--radius-theme-border);
transition: transform 0.3s ease; transition: transform 0.3s ease;
} }
} }
+1 -1
View File
@@ -18,7 +18,7 @@
flex-direction: column; flex-direction: column;
min-width: 0; min-width: 0;
padding: calc(var(--size-theme-font) * 0.875); padding: calc(var(--size-theme-font) * 0.875);
border: calc(var(--size-theme-font) * 0.0625) var(--style-theme-border) var(--color-theme-border-emphasis); border: var(--width-theme-border) var(--style-theme-border) var(--color-theme-border);
} }
.portfolio-card-cover { .portfolio-card-cover {
+1 -1
View File
@@ -43,7 +43,7 @@
width: calc(var(--size-theme-font) * 10); width: calc(var(--size-theme-font) * 10);
height: calc(var(--size-theme-font) * 10); height: calc(var(--size-theme-font) * 10);
overflow: hidden; overflow: hidden;
border-radius: calc(var(--size-theme-font) * 0.125); border-radius: var(--radius-theme-border);
} }
.post-cover-image { .post-cover-image {
+1
View File
@@ -13,6 +13,7 @@
--color-theme-accent-muted: color-mix(in srgb, var(--color-theme-accent) 60%, var(--color-theme-background)); --color-theme-accent-muted: color-mix(in srgb, var(--color-theme-accent) 60%, var(--color-theme-background));
--color-theme-accent-subtle: color-mix(in srgb, var(--color-theme-accent) 30%, var(--color-theme-background)); --color-theme-accent-subtle: color-mix(in srgb, var(--color-theme-accent) 30%, var(--color-theme-background));
--color-theme-navigation: #3e3e3e; --color-theme-navigation: #3e3e3e;
--color-theme-navigation-background: var(--color-theme-background);
--color-theme-control: #3e3e3e; --color-theme-control: #3e3e3e;
--color-theme-surface: color-mix(in srgb, var(--color-theme-text) 5%, var(--color-theme-background)); --color-theme-surface: color-mix(in srgb, var(--color-theme-text) 5%, var(--color-theme-background));
--color-theme-surface-strong: color-mix(in srgb, var(--color-theme-text) 10%, var(--color-theme-background)); --color-theme-surface-strong: color-mix(in srgb, var(--color-theme-text) 10%, var(--color-theme-background));
+1
View File
@@ -19,3 +19,4 @@
@use "friends"; @use "friends";
@use "contact"; @use "contact";
@use "archives"; @use "archives";
@use "home";
+9 -14
View File
@@ -1,3 +1,8 @@
:root {
--width-theme-toc-border: 1px;
--color-theme-toc-border: color-mix(in srgb, var(--color-theme-border) 25%, var(--color-theme-background));
}
.toc { .toc {
position: fixed; position: fixed;
top: 20vh; top: 20vh;
@@ -18,7 +23,9 @@
max-width: calc(100vw - var(--size-theme-font) * 2.5); max-width: calc(100vw - var(--size-theme-font) * 2.5);
height: auto; height: auto;
max-height: calc(80vh - var(--size-theme-font) * 2); max-height: calc(80vh - var(--size-theme-font) * 2);
padding: calc(var(--size-theme-font) * 2.5) calc(var(--size-theme-font) * 0.75) calc(var(--size-theme-font) * 0.75); padding: calc(var(--size-theme-font) * 2.5) var(--size-theme-font) var(--size-theme-font);
border: var(--width-theme-toc-border) var(--style-theme-border) var(--color-theme-toc-border);
border-radius: var(--radius-theme-border);
background: var(--color-theme-background); background: var(--color-theme-background);
.toc-content { .toc-content {
@@ -62,7 +69,7 @@
.toc-list { .toc-list {
margin-left: var(--size-theme-font); margin-left: var(--size-theme-font);
border-left: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-border); border-left: 1px solid var(--color-theme-toc-border);
padding-left: calc(var(--size-theme-font) * 0.5); padding-left: calc(var(--size-theme-font) * 0.5);
} }
} }
@@ -113,18 +120,6 @@
} }
} }
body[data-layout-mode='fullscreen'] {
.toc.toc-visible {
border: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-border);
}
}
@media (max-width: 1400px) {
.toc.toc-visible {
border: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-border);
}
}
@media (max-width: 480px) { @media (max-width: 480px) {
.toc.toc-visible { .toc.toc-visible {
max-height: 60vh; max-height: 60vh;
+1
View File
@@ -1,3 +1,4 @@
$phone-max-width: 684px; $phone-max-width: 684px;
$phone-min-width: 695px; $phone-min-width: 695px;
$tablet-max-width: 899px; $tablet-max-width: 899px;
$navigation-mobile-width: $tablet-max-width;
+5 -1
View File
@@ -16,7 +16,11 @@
</h1> </h1>
</header> </header>
<div class="post-content"> <div class="post-content">
<ul> <p th:if="${#lists.isEmpty(posts.items)}">
<span th:text="#{page.category.empty}">No articles in this category.</span>
<a data-pjax th:href="@{/archives}" th:text="#{page.category.all}">View all articles</a>
</p>
<ul th:if="${not #lists.isEmpty(posts.items)}">
<li class="post-list" th:each="post : ${posts.items}"> <li class="post-list" th:each="post : ${posts.items}">
<a data-pjax class="post-meta" th:href="@{${post.status.permalink}}"> <a data-pjax class="post-meta" th:href="@{${post.status.permalink}}">
<time th:text="${#dates.format(post.spec.publishTime, '__${theme.config.general.time_style == 'custom' ? <time th:text="${#dates.format(post.spec.publishTime, '__${theme.config.general.time_style == 'custom' ?
+1 -56
View File
@@ -7,61 +7,6 @@
<title th:text="${site.title}">Site title</title> <title th:text="${site.title}">Site title</title>
</th:block> </th:block>
<th:block th:fragment="content"> <th:block th:fragment="content">
<section class="index-content framed" <th:block th:replace="~{modules/home :: home}"/>
th:if="${not #strings.isEmpty(theme.config.index_page.notice_title) and not #strings.isEmpty(theme.config.index_page.notice_content)}">
<h1 class="typed-text" th:text="${theme.config.index_page.notice_title}"></h1>
<div th:utext="${theme.config.index_page.notice_content}"></div>
</section>
<section id="sns" th:if="${theme.config.index_page.show_sns}">
<th:block th:replace="~{modules/sns}"/>
</section>
<section class="posts">
<article class="post on-list" th:each="post : ${posts.items}">
<div class="post-wrapper">
<div class="post-content-wrapper">
<header>
<h2 class="post-title">
<span class="pin" th:classappend="${theme.config?.index_page?.pin_pos}" th:if="${post.spec.pinned} and ${theme.config?.index_page?.show_pin}">
<svg class="icon-regular" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M5 2h14a1 1 0 0 1 1 1v19.143a.5.5 0 0 1-.766.424L12 18.03l-7.234 4.536A.5.5 0 0 1 4 22.143V3a1 1 0 0 1 1-1m13 2H6v15.432l6-3.761l6 3.761z" />
</svg>
<svg class="icon-pixel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M18 2H6v2h12v16h-2v-2h-2v-2h-4v2H8v2H6V2H4v20h4v-2h2v-2h4v2h2v2h4V2z" />
</svg>
</span>
<a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a>
</h2>
<div class="post-title-time">
<time class="post-date"
th:text="${#dates.format(post.spec.publishTime, '__${theme.config.general.time_style == 'custom' ?
theme.config.general.custom_time_style : theme.config.general.time_style}__')}">Publish Time</time>
<span class="post-author"
th:with="contributor = ${post.contributors[0]}"
th:text="${contributor.displayName}">Author</span>
<th:block th:replace="~{modules/tag-list(post = ${post}, show = ${theme.config.index_page.show_tags})}"/>
</div>
</header>
<div class="post-excerpt">
<span th:text="${post.status.excerpt}">Post Excerpt...</span>
</div>
</div>
<div class="post-cover-wrapper" th:if="${post.spec.cover}">
<img class="post-cover-image"
th:src="${post.spec.cover}"
th:srcset="|${thumbnail.gen(post.spec.cover, 's')} 400w, ${thumbnail.gen(post.spec.cover, 'm')} 800w, ${thumbnail.gen(post.spec.cover, 'l')} 1200w|"
sizes="(max-width: 800px) 100vw, 400px"
th:alt="${post.spec.title}"
loading="lazy"/>
</div>
</div>
</article>
</section>
<th:block th:replace="~{modules/pagination :: page(
hasPrevious=${posts.hasPrevious()},
previousUrl=@{${posts.prevUrl}},
hasNext=${posts.hasNext()},
nextUrl=@{${posts.nextUrl}},
previousClass=''
)}"/>
</th:block> </th:block>
</html> </html>
+25 -3
View File
@@ -53,6 +53,21 @@
--width-theme-border: [(${theme.config.global_style.border_width})]; --width-theme-border: [(${theme.config.global_style.border_width})];
} }
</style> </style>
<style data-no-pjax th:if="${not #strings.isEmpty(theme.config.global_style?.border_width_px)}" th:inline="css">
:root {
--width-theme-border: [(${theme.config.global_style.border_width_px})]px;
}
</style>
<style data-no-pjax th:if="${not #strings.isEmpty(theme.config.post_page?.toc_border_width_px)}" th:inline="css">
:root {
--width-theme-toc-border: [(${theme.config.post_page.toc_border_width_px})]px;
}
</style>
<style data-no-pjax th:if="${not #strings.isEmpty(theme.config.post_page?.toc_border_color)}" th:inline="css">
:root {
--color-theme-toc-border: [(${theme.config.post_page.toc_border_color})];
}
</style>
<style data-no-pjax th:if="${not #strings.isEmpty(theme.config.global_style.border_style)}" th:inline="css"> <style data-no-pjax th:if="${not #strings.isEmpty(theme.config.global_style.border_style)}" th:inline="css">
:root { :root {
--style-theme-border: [(${theme.config.global_style.border_style})]; --style-theme-border: [(${theme.config.global_style.border_style})];
@@ -116,6 +131,10 @@
--color-theme-navigation: [(${#strings.isEmpty(scheme.navigation) ? scheme.menu : scheme.navigation})]; --color-theme-navigation: [(${#strings.isEmpty(scheme.navigation) ? scheme.menu : scheme.navigation})];
[/] [/]
[# th:if="${not #strings.isEmpty(scheme.navigation_background)}"]
--color-theme-navigation-background: [(${scheme.navigation_background})];
[/]
[# th:if="${not #strings.isEmpty(scheme.control) or not #strings.isEmpty(scheme.header)}"] [# th:if="${not #strings.isEmpty(scheme.control) or not #strings.isEmpty(scheme.header)}"]
--color-theme-control: [(${#strings.isEmpty(scheme.control) ? scheme.header : scheme.control})]; --color-theme-control: [(${#strings.isEmpty(scheme.control) ? scheme.header : scheme.control})];
[/] [/]
@@ -229,11 +248,14 @@
<body th:attr="data-layout-mode=${theme.config.layout.fullscreen_layout ? 'fullscreen' : 'normal'}, <body th:attr="data-layout-mode=${theme.config.layout.fullscreen_layout ? 'fullscreen' : 'normal'},
data-table-full-width=${theme.config.layout.table_full_width ? 'true' : 'false'}"> data-table-full-width=${theme.config.layout.table_full_width ? 'true' : 'false'}">
<div class="wrapper"> <div class="wrapper">
<header class="header">
<div class="header-container"
th:attr="style=${theme.config.layout.fullscreen_layout or #strings.isEmpty(theme.config.layout.max_width) ? null : 'max-width:' + theme.config.layout.max_width}">
<th:block th:replace="~{modules/header :: header}"/>
</div>
</header>
<div class="container" <div class="container"
th:attr="style=${theme.config.layout.fullscreen_layout or #strings.isEmpty(theme.config.layout.max_width) ? null : 'max-width:' + theme.config.layout.max_width}"> th:attr="style=${theme.config.layout.fullscreen_layout or #strings.isEmpty(theme.config.layout.max_width) ? null : 'max-width:' + theme.config.layout.max_width}">
<header class="header">
<th:block th:replace="~{modules/header :: header}"/>
</header>
<main class="content"> <main class="content">
<th:block th:replace="${content}"/> <th:block th:replace="${content}"/>
</main> </main>
+35 -212
View File
@@ -1,218 +1,33 @@
<th:block th:fragment="header" th:with="menu = ${menuFinder.getPrimary()}"> <th:block th:fragment="header" th:with="menu = ${menuFinder.getPrimary()}">
<div class="header-inner"> <a class="header-brand" data-pjax th:href="@{/}"
<div class="header-logo"> th:attr="aria-label=|${site.title} - #{page.error.back}|">
<a data-pjax th:href="@{/}"> <img class="header-brand-logo" th:if="${not #strings.isEmpty(site.logo)}"
<div class="logo" th:src="${site.logo}" alt="" width="36" height="36"/>
th:text="${#strings.isEmpty(theme.config.header.logo) ? site.title : theme.config.header.logo}"> <span class="header-brand-fallback" th:if="${#strings.isEmpty(site.logo)}" aria-hidden="true">&gt;_</span>
Blog Title <span class="header-brand-title" th:text="${site.title}" th:title="${site.title}">Blog Title</span>
</div>
</a> </a>
</div> <button class="navigation-toggle" type="button" aria-controls="site-navigation" aria-expanded="false"
<button th:if="${menu != null and not #lists.isEmpty(menu.menuItems)}"
th:each="button, buttonStat : ${theme.config.header.buttons}" th:attr="aria-label=#{header.navigation.open},
th:id="|search-button-${buttonStat.index}|" data-label-open=#{header.navigation.open},
class="header-action-button search-button" data-label-close=#{header.navigation.close}">
th:with="buttonOptions=${button.options}, <span aria-hidden="true"></span>
regularIcon=${buttonOptions?.iconify?.value}, <span aria-hidden="true"></span>
pixelIcon=${buttonOptions?.pixel_iconify?.value}" <span aria-hidden="true"></span>
th:attr="aria-label=#{header.search.open}"
th:style="|order: ${buttonStat.index}|"
type="button"
data-header-action="open-search"
th:if="${button.value == 'search' and pluginFinder.available('PluginSearchWidget')}">
<span class="icon-regular button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path
fill="currentColor"
d="m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5q0-2.725 1.888-4.612T9.5 3q2.725 0 4.612 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3l-1.4 1.4ZM9.5 14q1.875 0 3.188-1.313T14 9.5q0-1.875-1.313-3.188T9.5 5Q7.625 5 6.312 6.313T5 9.5q0 1.875 1.313 3.188T9.5 14Z"
/>
</svg>
</span>
<span class="icon-pixel button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor"
d="M6 2h8v2H6zM4 6V4h2v2zm0 8H2V6h2zm2 2H4v-2h2zm8 0v2H6v-2zm2-2h-2v2h2v2h2v2h2v2h2v-2h-2v-2h-2v-2h-2zm0-8h2v8h-2zm0 0V4h-2v2z"/>
</svg>
</span>
</button> </button>
<div <nav id="site-navigation" class="navigation-menu" th:attr="aria-label=#{header.navigation.label}">
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|color-scheme-picker-${buttonStat.index}|"
class="color-scheme-picker"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:style="|order: ${buttonStat.index}|"
th:if="${button.value == 'color_scheme'}">
<button
class="color-scheme-trigger"
type="button"
th:attr="aria-label=#{header.color_scheme.open},
aria-controls=|color-scheme-menu-${buttonStat.index}|"
aria-haspopup="listbox"
aria-expanded="false">
<span class="icon-regular button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M12.6 3.6c-5.96 0-10.8 4.3-10.8 9.6c0 3.97 3.23 7.2 7.2 7.2h1.98c.98 0 1.62-1 1.25-1.91c-.5-1.22.4-2.59 1.73-2.59h2.24c3.31 0 6-2.69 6-6c0-3.48-4.3-6.3-9.6-6.3ZM6 14.4a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm3.6-4.8a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm6 0a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Zm3.6 4.8a1.8 1.8 0 1 1 0-3.6a1.8 1.8 0 0 1 0 3.6Z"></path>
</svg>
</span>
<span class="icon-pixel button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="currentColor" d="M22.29 6.285h1.14V12h-1.14ZM21.143 12h1.147v2.287h-1.147Zm0-8.002h1.147v2.287h-1.147Zm-1.14 10.29h1.14v1.14h-1.14Zm0-11.43h1.14v1.14h-1.14Zm-1.148 12.57h1.148v1.147h-1.148Zm0-6.855h1.148v4.567h-1.148Zm-1.14 8.002h1.14v1.14h-1.14Zm0-3.435h1.14v1.148h-1.14Zm0-11.422h2.287v1.14h-2.287Zm-1.14 15.997h1.14v1.14h-1.14Zm0-3.427h1.14v1.14h-1.14Zm-1.147-6.855h3.427v1.14h-3.427Zm0 11.422h1.147v1.148h-1.147Zm-1.14 1.148h1.14v1.14h-1.14ZM12 15.428h4.575v1.147H12Zm2.288-6.855h1.14v1.14h-1.14Zm0-2.288h2.287v-1.14h1.14V3.998h-1.14v-1.14h-2.287v1.14h-1.14v1.147h1.14zm-1.14 14.858h1.14v1.14h-1.14Zm0-11.431h1.14v1.148h-1.14ZM12 10.86h1.148V12H12ZM6.285 22.283h6.863v1.147H6.285ZM10.86 12H12v3.428h-1.14ZM9.712.57h8.003v1.148H9.712Zm1.148 16.005H8.573v1.14h-1.14v2.288h1.14v1.14h2.287v-1.14H12v-2.288h-1.14zM7.433 1.718h2.28v1.14h-2.28Zm0 7.994h2.28v-1.14h1.147V6.285H9.713v-1.14h-2.28v1.14H6.284v2.287h1.147zm-3.428 5.716h2.28v-1.14h1.148V12H6.285v-1.14h-2.28V12H2.858v2.287h1.147zm1.14-12.57h2.288v1.14H5.145Zm0 18.285h1.14v1.14h-1.14Zm-2.287-1.14h2.287v1.14H2.858ZM4.005 3.998h1.14v1.147h-1.14ZM2.858 5.145h1.147v2.288H2.858Zm-1.14 12.57h1.14v2.287h-1.14Zm0-10.282h1.14v2.28h-1.14ZM.57 9.712h1.148v8.003H.57Z"/>
</svg>
</span>
</button>
<div
th:id="|color-scheme-menu-${buttonStat.index}|"
class="color-scheme-menu"
role="listbox"
th:attr="aria-label=#{header.color_scheme.list}"
hidden>
<button
class="color-scheme-option"
type="button"
role="option"
aria-selected="true"
data-color-scheme="default">
default
</button>
</div>
</div>
<button
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|appearance-toggle-${buttonStat.index}|"
class="header-action-button appearance-toggle"
th:with="buttonOptions=${button.options},
lightRegularIcon=${buttonOptions?.light_iconify?.value},
lightPixelIcon=${buttonOptions?.light_pixel_iconify?.value},
darkRegularIcon=${buttonOptions?.dark_iconify?.value},
darkPixelIcon=${buttonOptions?.dark_pixel_iconify?.value},
systemRegularIcon=${buttonOptions?.system_iconify?.value},
systemPixelIcon=${buttonOptions?.system_pixel_iconify?.value}"
th:attr="aria-label=#{header.appearance.current}"
th:style="|order: ${buttonStat.index}|"
th:if="${button.value == 'appearance'}"
type="button">
<span class="appearance-icon icon-regular button-icon" data-appearance-mode="light" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
th:utext="${not #strings.isEmpty(lightRegularIcon) ? lightRegularIcon : lightPixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4V2m0 18v2M6.414 6.414L5 5m12.728 12.728l1.414 1.414M4 12H2m18 0h2m-4.271-5.586L19.143 5M6.415 17.728L5 19.142M12 17a5 5 0 1 1 0-10a5 5 0 0 1 0 10"></path>
</svg>
</span>
<span class="appearance-icon icon-pixel button-icon" data-appearance-mode="light" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
th:utext="${not #strings.isEmpty(lightPixelIcon) ? lightPixelIcon : lightRegularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(lightRegularIcon) or not #strings.isEmpty(lightPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M13 22h-2v-3h2v3Zm-6-3H5v-2h2v2Zm12 0h-2v-2h2v2Zm-4-2H9v-2h6v2Zm-6-2H7V9h2v6Zm8 0h-2V9h2v6ZM5 13H2v-2h3v2Zm17 0h-3v-2h3v2Zm-7-4H9V7h6v2ZM7 7H5V5h2v2Zm12 0h-2V5h2v2Zm-6-2h-2V2h2v3Z"/>
</svg>
</span>
<span class="appearance-icon icon-regular button-icon" data-appearance-mode="dark" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
th:utext="${not #strings.isEmpty(darkRegularIcon) ? darkRegularIcon : darkPixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 6a9 9 0 0 0 9 9c.91 0 1.787-.134 2.614-.385A9 9 0 0 1 12 21A9 9 0 0 1 9.386 3.386A9 9 0 0 0 9 6"></path>
</svg>
</span>
<span class="appearance-icon icon-pixel button-icon" data-appearance-mode="dark" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
th:utext="${not #strings.isEmpty(darkPixelIcon) ? darkPixelIcon : darkRegularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(darkRegularIcon) or not #strings.isEmpty(darkPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M18 22H8v-2h10v2ZM8 20H6v-2h2v2Zm12 0h-2v-2h2v2ZM6 18H4v-2h2v2Zm16 0h-2v-4h-2v-2h2v-2h2v8ZM4 16H2V6h2v10Zm14 0h-6v-2h6v2Zm-6-2h-2v-2h2v2Zm-2-2H8V6h2v6ZM6 6H4V4h2v2Zm8-2h-2v2h-2V4H6V2h8v2Z"/>
</svg>
</span>
<span class="appearance-icon icon-regular button-icon" data-appearance-mode="system" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
th:utext="${not #strings.isEmpty(systemRegularIcon) ? systemRegularIcon : systemPixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="8" fill="none" stroke="currentColor" stroke-width="2"/>
</svg>
</span>
<span class="appearance-icon icon-pixel button-icon" data-appearance-mode="system" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
th:utext="${not #strings.isEmpty(systemPixelIcon) ? systemPixelIcon : systemRegularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(systemRegularIcon) or not #strings.isEmpty(systemPixelIcon)}"
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<path d="M18 4h-6v3H9v2H7v6h2v2h3v3h6v2H6v-2H4v-2H2V6h2V4h2V2h12v2Zm2 16h-2v-2h2v2Zm2-2h-2V6h2v12Zm-7-9h2v6h-2v2h-3V7h3v2Zm5-3h-2V4h2v2Z"></path>
</svg>
</span>
</button>
<button
th:each="button, buttonStat : ${theme.config.header.buttons}"
th:id="|pixel-toggle-${buttonStat.index}|"
class="header-action-button pixel-toggle"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:attr="aria-label=#{header.pixel_style.toggle}"
th:style="|order: ${buttonStat.index}|"
th:if="${button.value == 'pixel_style'}"
type="button">
<span class="icon-pixel button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M13.75 20.75h-3.5v-3.5h3.5v3.5Zm7 0h-3.5v-3.5h3.5v3.5Zm-7-7h-7v3.5h-3.5v-14h10.5v10.5Zm3.5 3.5h-3.5v-3.5h3.5v3.5Zm3.5-3.5h-3.5v-3.5h3.5v3.5Zm-14-3.5h3.5v-3.5h-3.5v3.5Z"/>
</svg>
</span>
<span class="icon-regular button-icon" aria-hidden="true">
<th:block th:if="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></th:block>
<svg th:unless="${not #strings.isEmpty(regularIcon) or not #strings.isEmpty(pixelIcon)}"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
<path d="M13.75 20.75h-3.5v-3.5h3.5v3.5Zm7 0h-3.5v-3.5h3.5v3.5Zm-7-7h-7v3.5h-3.5v-14h10.5v10.5Zm3.5 3.5h-3.5v-3.5h3.5v3.5Zm3.5-3.5h-3.5v-3.5h3.5v3.5Zm-14-3.5h3.5v-3.5h-3.5v3.5Z"/>
</svg>
</span>
</button>
<th:block th:each="button, buttonStat : ${theme.config.header.buttons}">
<button
class="header-action-button custom-header-button"
type="button"
data-header-action="custom"
th:with="buttonOptions=${button.options},
regularIcon=${buttonOptions?.iconify?.value},
pixelIcon=${buttonOptions?.pixel_iconify?.value}"
th:if="${button.value == 'custom'
and button.options != null
and not #strings.isEmpty(button.options.name)
and (not #strings.isEmpty(button.options.iconify?.value)
or not #strings.isEmpty(button.options.pixel_iconify?.value))}"
th:style="|order: ${buttonStat.index}|"
th:attr="aria-label=${buttonOptions.name},
title=${buttonOptions.name},
data-onclick=${buttonOptions.onclick}">
<span class="icon-regular button-icon" aria-hidden="true"
th:utext="${not #strings.isEmpty(regularIcon) ? regularIcon : pixelIcon}"></span>
<span class="icon-pixel button-icon" aria-hidden="true"
th:utext="${not #strings.isEmpty(pixelIcon) ? pixelIcon : regularIcon}"></span>
</button>
</th:block>
</div>
<nav class="navigation-menu">
<ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}" <ul th:if="${menu != null} and ${not #lists.isEmpty(menu.menuItems)}"
class="navigation-menu-inner menu--desktop"> class="navigation-menu-inner">
<li th:each="menuItem : ${menu.menuItems}"> <li th:each="menuItem, menuStat : ${menu.menuItems}"
th:with="menuHref=${menuItem.status.displayName == '文章' ? '/archives' : menuItem.status.href}"
th:if="${menuItem.status.displayName != '首页'
and not #strings.equalsIgnoreCase(menuItem.status.displayName, 'home')
and menuItem.status.href != '/'
and menuItem.status.href != site.url
and menuItem.status.href != site.url + '/'}">
<div th:if="${#lists.isEmpty(menuItem.children)}"> <div th:if="${#lists.isEmpty(menuItem.children)}">
<a data-pjax <a data-pjax
th:href="@{${menuItem.status.href}}" th:href="@{${menuHref}}"
th:target="${menuItem.spec.target?.value}" th:target="${menuItem.spec.target?.value}"
th:text="${menuItem.status.displayName}"></a> th:text="${menuItem.status.displayName}"></a>
</div> </div>
@@ -220,13 +35,21 @@
<div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu"> <div th:if="${not #lists.isEmpty(menuItem.children)}" class="menu">
<div class="menu-wrapper"> <div class="menu-wrapper">
<a data-pjax <a data-pjax
th:href="@{${menuItem.status.href}}" th:href="@{${menuHref}}"
th:target="${menuItem.spec.target?.value}"> th:target="${menuItem.spec.target?.value}">
<span th:text="${menuItem.status.displayName}"></span> <span th:text="${menuItem.status.displayName}"></span>
</a> </a>
<span class="menu-trigger">▾</span> <button class="menu-trigger" type="button" aria-expanded="false"
th:attr="aria-label=|#{header.navigation.submenu} ${menuItem.status.displayName}|,
aria-controls=|navigation-submenu-${menuStat.index}|">
<svg class="menu-chevron" viewBox="0 0 12 12" fill="none"
aria-hidden="true" focusable="false">
<path d="m3 4.5 3 3 3-3" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div> </div>
<ul class="menu-dropdown"> <ul class="menu-dropdown" th:id="|navigation-submenu-${menuStat.index}|">
<li th:each="childMenuItem : ${menuItem.children}"> <li th:each="childMenuItem : ${menuItem.children}">
<a data-pjax <a data-pjax
th:href="@{${childMenuItem.status.href}}" th:href="@{${childMenuItem.status.href}}"
+216
View File
@@ -0,0 +1,216 @@
<div class="homepage" th:fragment="home" th:attr="data-intro-style=${theme.config.index_page?.intro_style ?: 'detailed'}"
th:with="home=${theme.config.index_page},
profileEnabled=${home?.profile_enable != false},
hasWelcome=${not #strings.isEmpty(home.notice_title) or not #strings.isEmpty(home.notice_content)},
hasProfileText=${not #strings.isEmpty(home?.profile_name) or not #strings.isEmpty(home?.profile_role) or not #strings.isEmpty(home?.profile_bio) or not #strings.isEmpty(home?.profile_url)},
hasProfile=${hasProfileText or not #strings.isEmpty(home?.profile_photo)},
noteLimit=${home?.note_limit ?: 6},
lifeLimit=${home?.life_limit ?: 6},
bookLimit=${home?.book_limit ?: 4},
projectLimit=${home?.project_limit ?: 4},
articleSource=${home?.article_source ?: 'all'},
dateFormat=${theme.config.general.time_style == 'custom' ? theme.config.general.custom_time_style : theme.config.general.time_style},
categories=${categoryFinder.listAll()},
lifeMatches=${categories.?[spec.displayName == '生活' or spec.slug == 'life']},
lifeCategoryName=${not #strings.isEmpty(home?.life_category) ? home.life_category : (not #lists.isEmpty(lifeMatches) ? lifeMatches[0].metadata.name : null)},
noteCategoryName=${articleSource == 'category' ? home?.note_category : null},
lifeCategory=${#strings.isEmpty(lifeCategoryName) ? null : categoryFinder.getByName(lifeCategoryName)},
noteCategory=${#strings.isEmpty(noteCategoryName) ? null : categoryFinder.getByName(noteCategoryName)},
lifeCategoryNames=${lifeCategory == null ? {} : categories.?[metadata.name == #vars.lifeCategory.metadata.name or #lists.contains(#vars.categoryFinder.getBreadcrumbs(metadata.name).![metadata.name], #vars.lifeCategory.metadata.name)].![metadata.name]},
noteCategoryNames=${lifeCategory == null or noteCategory == null ? {} : categories.?[metadata.name == #vars.noteCategory.metadata.name or #lists.contains(#vars.categoryFinder.getBreadcrumbs(metadata.name).![metadata.name], #vars.noteCategory.metadata.name)].![metadata.name]},
sourcePosts=${lifeCategory == null ? (noteCategory != null ? postFinder.list({page: 1, size: noteLimit, categoryName: noteCategory.metadata.name}) : postFinder.list({page: 1, size: noteLimit})).items : postFinder.listAll()},
notes=${lifeCategory == null ? sourcePosts : sourcePosts.?[
status.hideFromList != true
and (#vars.noteCategory == null or (not #lists.isEmpty(spec.categories) and not #lists.isEmpty(spec.categories.?[#lists.contains(#vars.noteCategoryNames, #this)])))
and (#lists.isEmpty(spec.categories) or #lists.isEmpty(spec.categories.?[#lists.contains(#vars.lifeCategoryNames, #this)]))
]},
books=${home?.books},
manualProjects=${home?.projects},
usePortfolioPlugin=${home?.project_source != 'manual' and pluginFinder.available('portfolio')}">
<div class="home-intro" th:if="${hasWelcome or (profileEnabled and hasProfile)}"
th:attr="data-split=${profileEnabled ? (home?.profile_split ?: 'aligned') : 'single'}">
<aside class="home-profile" th:if="${profileEnabled and hasProfile}" th:attr="aria-label=#{home.profile.title}">
<div class="home-profile-copy" th:if="${hasProfileText}">
<h2 class="home-profile-name" th:if="${not #strings.isEmpty(home?.profile_name)}" th:text="${home.profile_name}"></h2>
<p class="home-profile-role" th:if="${not #strings.isEmpty(home?.profile_role)}" th:text="${home.profile_role}"></p>
<p class="home-profile-bio" th:if="${not #strings.isEmpty(home?.profile_bio)}" th:text="${home.profile_bio}"></p>
<a class="home-profile-link" th:if="${not #strings.isEmpty(home?.profile_url)}"
th:href="${home.profile_url}" th:text="#{home.profile.more}">About me</a>
</div>
<img class="home-profile-photo" th:if="${not #strings.isEmpty(home?.profile_photo)}"
th:src="${home.profile_photo}"
th:alt="${not #strings.isEmpty(home?.profile_name) ? home.profile_name : #messages.msg('home.profile.photo')}"
width="112" height="140" decoding="async"/>
</aside>
<section class="index-content home-welcome" th:if="${hasWelcome}">
<svg class="home-welcome-art" viewBox="0 0 360 160" fill="none" aria-hidden="true" focusable="false"
th:if="${home?.intro_style != 'plain'}">
<g stroke="currentColor" stroke-width="1">
<path d="M16 124h92l36-36h104l48-48h48M64 148h78l32-32h90l48-48h32M112 28h58l32 32h80l26-26h36"/>
<path d="M208 4v24l28 28M280 160v-24l40-40h24"/>
<circle cx="16" cy="124" r="3"/><circle cx="64" cy="148" r="3"/>
<circle cx="112" cy="28" r="3"/><circle cx="208" cy="4" r="3"/>
<circle cx="344" cy="40" r="3"/><circle cx="344" cy="68" r="3"/>
<circle cx="344" cy="34" r="3"/><circle cx="344" cy="96" r="3"/>
</g>
</svg>
<h1 class="typed-text" th:if="${not #strings.isEmpty(home.notice_title)}" th:text="${home.notice_title}">Hello Terminal!</h1>
<div class="home-welcome-description" th:if="${not #strings.isEmpty(home.notice_content)}"
th:utext="${home.notice_content}"></div>
<div class="home-welcome-footer" th:if="${home.show_sns or home?.intro_style != 'plain'}">
<div id="sns" class="home-social" th:if="${home.show_sns}">
<th:block th:replace="~{modules/sns :: sns}"/>
</div>
<nav class="home-welcome-links" th:if="${home?.intro_style != 'plain'}" th:attr="aria-label=#{home.welcome.links}">
<a data-pjax href="/archives"><span th:text="#{home.welcome.articles}">Article archive</span><svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3 8h10M9 4l4 4-4 4"/></svg></a>
<a data-pjax th:href="${#strings.isEmpty(home?.projects_more_url) ? '/portfolio' : home.projects_more_url}"><span th:text="#{home.projects.title}">Portfolio</span><svg viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="M3 8h10M9 4l4 4-4 4"/></svg></a>
</nav>
</div>
</section>
</div>
<section id="sns" class="home-social" th:if="${home.show_sns and not hasWelcome}">
<th:block th:replace="~{modules/sns :: sns}"/>
</section>
<div class="home-row home-row--top">
<section class="home-section home-notes" aria-labelledby="home-notes-title">
<header class="home-section-heading">
<h2 id="home-notes-title" th:text="#{home.notes.title}">Articles</h2>
<a data-pjax class="home-more"
th:href="${noteCategory != null ? noteCategory.status.permalink : '/archives'}"
th:text="#{home.notes.more}">More</a>
</header>
<div class="posts home-note-list" th:if="${not #lists.isEmpty(notes)}"
th:attr="data-columns=${home?.article_columns ?: 'auto'}">
<th:block th:each="post, postStat : ${notes}">
<th:block th:if="${postStat.index < noteLimit}">
<th:block th:replace="~{modules/home :: note(post=${post})}"/>
</th:block>
</th:block>
</div>
<p class="home-empty" th:if="${#lists.isEmpty(notes)}" th:text="#{home.notes.empty}">No articles yet.</p>
</section>
<section class="home-section home-life" aria-labelledby="home-life-title">
<header class="home-section-heading">
<h2 id="home-life-title" th:text="#{home.life.title}">Life</h2>
<a data-pjax class="home-more"
th:href="${lifeCategory != null ? lifeCategory.status.permalink : '/categories'}" th:text="#{home.life.more}">More</a>
</header>
<div class="home-life-list">
<th:block th:if="${lifeCategory != null}"
th:with="lifePosts=${postFinder.list({page: 1, size: lifeLimit, categoryName: lifeCategory.metadata.name, sort: {'spec.publishTime,desc'}})}">
<article class="home-life-post" th:each="post : ${lifePosts.items}">
<a class="home-life-cover" data-pjax th:if="${not #strings.isEmpty(post.spec.cover)}"
th:href="${post.status.permalink}" th:attr="aria-label=${post.spec.title}">
<img th:src="${post.spec.cover}" alt="" width="96" height="96" loading="lazy" decoding="async"/>
</a>
<div class="home-life-copy">
<h3><a data-pjax th:href="${post.status.permalink}" th:text="${post.spec.title}" th:title="${post.spec.title}">Post title</a></h3>
<time class="post-title-time" th:if="${post.spec.publishTime != null}"
th:datetime="${post.spec.publishTime}" th:text="${#dates.format(post.spec.publishTime, dateFormat)}"></time>
<p class="home-summary" th:if="${not #strings.isEmpty(post.status.excerpt)}"
th:text="${post.status.excerpt}"></p>
</div>
</article>
<p class="home-empty" th:if="${#lists.isEmpty(lifePosts.items)}" th:text="#{home.life.empty}">Life, to be continued.</p>
</th:block>
<p class="home-empty" th:if="${lifeCategory == null}" th:text="#{home.life.empty}">Life, to be continued.</p>
</div>
</section>
</div>
<div class="home-row home-row--bottom">
<section class="home-section home-reading" aria-labelledby="home-reading-title">
<header class="home-section-heading">
<h2 id="home-reading-title" th:text="#{home.reading.title}">Reading</h2>
<a data-pjax class="home-more"
th:href="${#strings.isEmpty(home?.books_more_url) ? '/read' : home.books_more_url}" th:text="#{home.reading.more}">More</a>
</header>
<div class="home-book-grid" th:if="${not #lists.isEmpty(books)}">
<article class="home-book" th:each="book, bookStat : ${books}" th:if="${bookStat.index < bookLimit}">
<a class="home-book-cover" data-pjax th:href="${#strings.isEmpty(book.url) ? null : book.url}"
th:attr="aria-label=${book.title}">
<img th:if="${not #strings.isEmpty(book.cover)}" th:src="${book.cover}" th:alt="${book.title}"
width="240" height="360" loading="lazy"/>
<span class="home-book-placeholder" th:if="${#strings.isEmpty(book.cover)}" th:text="${book.title}"></span>
</a>
<h3 class="home-book-title" th:text="${book.title}">Book title</h3>
<p class="home-book-comment" th:if="${not #strings.isEmpty(book.comment)}"
th:text="${book.comment}" th:title="${book.comment}"></p>
</article>
</div>
<p class="home-empty" th:if="${#lists.isEmpty(books)}" th:text="#{home.reading.empty}">A place for books and thoughts.</p>
</section>
<section class="home-section home-projects" aria-labelledby="home-projects-title">
<header class="home-section-heading">
<h2 id="home-projects-title" th:text="#{home.projects.title}">Portfolio</h2>
<a data-pjax class="home-more"
th:href="${#strings.isEmpty(home?.projects_more_url) ? '/portfolio' : home.projects_more_url}"
th:text="#{home.projects.more}">More</a>
</header>
<!-- Keep plugin Finder calls inside the availability guard. -->
<th:block th:if="${usePortfolioPlugin}" th:with="projectResult=${projectFinder.list(1, projectLimit)}">
<div class="home-project-grid" th:if="${not #lists.isEmpty(projectResult.items)}">
<th:block th:each="project : ${projectResult.items}">
<th:block th:replace="~{modules/home :: project(title=${project.title}, cover=${project.cover}, summary=${project.summary}, url=@{/portfolio/{slug}(slug=${project.slug})}, repoUrl=${project.repoUrl})}"/>
</th:block>
</div>
<p class="home-empty" th:if="${#lists.isEmpty(projectResult.items)}" th:text="#{home.projects.empty}">Projects in progress.</p>
</th:block>
<th:block th:unless="${usePortfolioPlugin}">
<div class="home-project-grid" th:if="${not #lists.isEmpty(manualProjects)}">
<th:block th:each="project, projectStat : ${manualProjects}">
<th:block th:if="${projectStat.index < projectLimit}">
<th:block th:replace="~{modules/home :: project(title=${project.title}, cover=${project.cover}, summary=${project.summary}, url=${project.url}, repoUrl=${project.repoUrl})}"/>
</th:block>
</th:block>
</div>
<p class="home-empty" th:if="${#lists.isEmpty(manualProjects)}" th:text="#{home.projects.empty}">Projects in progress.</p>
</th:block>
</section>
</div>
</div>
<article class="home-note-post home-article-card" th:fragment="note(post)">
<a class="home-article-link" data-pjax th:href="${post.status.permalink}" th:title="${post.spec.title}"
th:attr="aria-labelledby=|home-article-title-${post.metadata.name}|">
<div class="home-article-cover">
<img th:if="${not #strings.isEmpty(post.spec.cover)}" th:src="${post.spec.cover}" th:alt="${post.spec.title}"
th:srcset="|${thumbnail.gen(post.spec.cover, 's')} 400w, ${thumbnail.gen(post.spec.cover, 'm')} 800w, ${thumbnail.gen(post.spec.cover, 'l')} 1200w|"
sizes="(max-width: 480px) 100vw, (max-width: 899px) 50vw, 33vw"
width="480" height="480" loading="lazy"/>
<span class="home-article-placeholder" th:if="${#strings.isEmpty(post.spec.cover)}" aria-hidden="true">&gt;_</span>
<span class="home-article-pin" th:if="${post.spec.pinned and home?.show_pin}" th:text="#{home.notes.pinned}">Pinned</span>
</div>
<div class="home-article-content">
<h3 class="home-article-title" th:id="|home-article-title-${post.metadata.name}|" th:text="${post.spec.title}">Post title</h3>
<p class="home-article-excerpt" th:text="${post.status.excerpt}"></p>
<time class="home-article-date" th:if="${post.spec.publishTime != null}" th:datetime="${post.spec.publishTime}"
th:text="${#dates.format(post.spec.publishTime, dateFormat)}"></time>
<div class="home-article-tags" th:if="${home.show_tags}">
<span th:each="tag : ${post.tags}" th:text="|#${tag.spec.displayName}|" th:title="${tag.spec.displayName}"></span>
</div>
</div>
</a>
</article>
<article class="home-project" th:fragment="project(title, cover, summary, url, repoUrl)">
<a class="home-project-cover" data-pjax th:if="${not #strings.isEmpty(cover)}"
th:href="${#strings.isEmpty(url) ? null : url}" th:attr="aria-label=${title}">
<img th:src="${cover}" th:alt="${title}" width="640" height="360" loading="lazy"/>
</a>
<h3 class="post-title home-project-title">
<a data-pjax th:href="${#strings.isEmpty(url) ? null : url}" th:text="${title}">Project title</a>
</h3>
<p class="home-summary" th:if="${not #strings.isEmpty(summary)}" th:text="${summary}"></p>
<a class="home-repository" th:if="${not #strings.isEmpty(repoUrl)}" th:href="${repoUrl}"
target="_blank" rel="noopener noreferrer">
<svg th:if="${#strings.contains(repoUrl, 'github.com/')}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2.3c-3.3.7-4-1.4-4-1.4-.5-1.4-1.3-1.7-1.3-1.7-1.1-.8.1-.8.1-.8 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.6.1-3.2 0 0 1-.3 3.3 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.9.1 3.2.8.8 1.2 1.9 1.2 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3Z"/>
</svg>
<span th:text="${#strings.contains(repoUrl, 'github.com/') ? 'GitHub' : #messages.msg('page.portfolio.repository')}">GitHub</span>
</a>
</article>
+1 -1
View File
@@ -16,7 +16,7 @@ spec:
issues: https://github.com/z1178902213/halo-theme-terminal/issues issues: https://github.com/z1178902213/halo-theme-terminal/issues
settingName: "theme-terminal-witcher-setting" settingName: "theme-terminal-witcher-setting"
configMapName: "theme-terminal-witcher-configMap" configMapName: "theme-terminal-witcher-configMap"
version: 3.1.0 version: 3.1.17
requires: ">=2.22.0" requires: ">=2.22.0"
license: license:
- name: "MIT" - name: "MIT"