From d3ba189a7d11f0139f597ebea2204f39b62712c1 Mon Sep 17 00:00:00 2001 From: nxxy335 Date: Sat, 26 Sep 2026 17:30:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E3=80=8C=E8=AE=B0?= =?UTF-8?q?=E5=BE=97=E3=80=8D=E6=8F=92=E4=BB=B6=EF=BC=88plugin-important-d?= =?UTF-8?q?ates=EF=BC=89=E4=B8=BB=E9=A2=98=E9=80=82=E9=85=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20(v1.1.10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 templates/important-dates.html 覆盖插件默认模板,融入暖屿外观 - 居中标题区(标题/副标题可配置)+ 强调线,与书架、友链等页面一致 - 生活 / 爱车双视图切换,地址栏记忆 ?view=car - 到期提醒横幅(重要日期 + 座驾到期),支持逐条忽略并记录在本地 - 重要日期便签卡片:倒计时、日期、农历标记、关联的人 - 牵挂的人卡片:大头贴(失效回退首字)、昵称、关系、脱敏生日与倒计时 - 爱车卡片:封面相册、分类品牌、脱敏车牌、到期徽章(临近/逾期)、车主与驾驶人 - 相册浮层运行时移到 body,避免被 .wi-main 层叠上下文困住而被导航/页脚遮挡 - 暗黑模式随主题变量自动适配 - settings.yaml 新增 important_dates 设置组(页面标题/副标题) - 文档:README 插件表、docs/config/important-dates.md、docs/pages/important-dates.md - 版本升至 1.1.10 --- README.md | 5 +- docs/.vitepress/config.mts | 2 + docs/config/important-dates.md | 40 + docs/pages/extended.md | 13 + docs/pages/important-dates.md | 55 ++ package.json | 2 +- settings.yaml | 12 + src/pages/important-dates.astro | 1360 +++++++++++++++++++++++++++++++ theme.yaml | 2 +- 9 files changed, 1487 insertions(+), 4 deletions(-) create mode 100644 docs/config/important-dates.md create mode 100644 docs/pages/important-dates.md create mode 100644 src/pages/important-dates.astro diff --git a/README.md b/README.md index c39d755..3dcc5cc 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ ## 特点 1. **响应式设计** — 适配桌面端与移动端,支持暗色模式,移动端使用动态视口单位适配地址栏 -2. **插件兼容性** — 适配 9 款常用 Halo 插件,安装即用;提供页面布局契约,插件前台页面自动复用主题外观 +2. **插件兼容性** — 适配 10 款常用 Halo 插件,安装即用;提供页面布局契约,插件前台页面自动复用主题外观 3. **内置灯箱** — 主题内置 LightGallery 灯箱,支持 EXIF 信息展示;安装 lightgallery.js 插件后自动禁用 -4. **可配置性** — 16 个设置分组、117 个配置项,几乎所有模块可独立开关 +4. **可配置性** — 17 个设置分组、122 个配置项,几乎所有模块可独立开关 5. **性能优化** — 服务端字数统计(API 扩展包)、图片懒加载与响应式缩略图、滚动吸附、CSS/HTML 压缩 6. **页面布局契约** — 提供 `templates/layout.html`,插件页面不再回退到 Halo 内置布局 @@ -33,6 +33,7 @@ | [豆瓣](https://github.com/chengzhongxue/plugin-douban) | `plugin-douban` | `/douban` | 豆瓣记录页面,支持类型/状态/标签筛选,默认电影 | | [Steam 信息展示](https://github.com/Tim0x0/halo-plugin-steam) | `PluginSteam` | `/steam` | Steam 游戏库页面,含用户资料、统计数据、最近游玩、游戏库分页 | | [微信读书](https://github.com/yeora26/halo-weread-plugin) | `halo-weread-plugin` | 自定义页面 | 书架展示页面,见下方「自定义页面模板」 | +| [记得](https://github.com/yyliucha/plugin-important-dates) | `plugin-important-dates` | `/important-dates` | 重要日期 / 牵挂的人 / 爱车双视图页面,见下方「扩展页面」 | | [API 扩展包](https://github.com/HowieHz/halo-plugin-extra-api) | `extra-api` | 全站 | 服务端字数统计、中英文混排排版、可选服务端代码高亮 | > **注意**:插件需要单独安装,安装后主题会自动适配对应页面。若未安装某插件,对应页面或功能自动隐藏/降级,不会报错。 diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index e37fc57..a1c2dd9 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -36,6 +36,7 @@ export default defineConfig({ { text: '图库', link: '/config/photos' }, { text: '友情链接', link: '/config/links' }, { text: '朋友圈', link: '/config/friends' }, + { text: '记得', link: '/config/important-dates' }, { text: '留言板', link: '/config/messageboard' }, { text: '评论', link: '/config/comment' }, { text: '页脚', link: '/config/footer' }, @@ -53,6 +54,7 @@ export default defineConfig({ { text: '图库', link: '/pages/photos' }, { text: '友情链接', link: '/pages/links' }, { text: '朋友圈', link: '/pages/friends' }, + { text: '记得', link: '/pages/important-dates' }, { text: '自定义页面', link: '/pages/custom-page' }, { text: '扩展页面', link: '/pages/extended' }, ] diff --git a/docs/config/important-dates.md b/docs/config/important-dates.md new file mode 100644 index 0000000..9bc1d32 --- /dev/null +++ b/docs/config/important-dates.md @@ -0,0 +1,40 @@ +# 记得 + +「记得」模块对应 [plugin-important-dates](https://github.com/yyliucha/plugin-important-dates) 插件的前台页面 `/important-dates`,用于展示重要日期、牵挂的人与座驾(爱车)信息。 + +## 配置项一览 + +| 配置项 | 类型 | 默认值 | 说明 | +| --- | --- | --- | --- | +| `idates_page_title` | 文本 | `记得` | 页面标题,留空时使用插件自带标题 | +| `idates_page_subtitle` | 文本 | `记着重要的日子、惦记的人,还有陪你跑的爱车` | 页面副标题 | + +```yaml +idates_page_title: "记得" # 默认 +idates_page_title: "纪念日" # 自定义 +idates_page_subtitle: "记着重要的日子、惦记的人,还有陪你跑的爱车" +``` + +## 前置依赖 + +::: danger +本页依赖 Halo 的 **plugin-important-dates**(记得)插件。未安装插件时 `/important-dates` 路由不存在,页面不会显示。 + +安装方式:Halo 后台 → **插件** → **安装** → 上传 jar,或直接前往 [GitHub Releases](https://github.com/yyliucha/plugin-important-dates/releases) 下载。 +::: + +## 数据来源 + +页面数据全部由插件提供,主题不读取任何隐私字段: + +- `dates` — 重要日期(名称、日期、农历标记、关联人员、倒计时) +- `people` — 牵挂的人(昵称、关系、脱敏生日、生日倒计时、大头贴) +- `cars` — 座驾(分类、品牌型号、脱敏车牌、到期事项、相册) +- `reminders` / `carEvents` — 顶部到期提醒横幅 + +是否展示「重要」标记、大头贴、爱车视图等,均由插件自己的「设置」控制,主题侧只负责呈现。 + +## 相关页面 + +- [扩展页面](/pages/extended) — 全部插件扩展页面一览 +- [记得页面](/pages/important-dates) — 页面结构与模板覆盖说明 diff --git a/docs/pages/extended.md b/docs/pages/extended.md index 7362299..a70b9d0 100644 --- a/docs/pages/extended.md +++ b/docs/pages/extended.md @@ -14,6 +14,7 @@ WarmIsland 主题深度集成了多款 Halo 插件,提供了丰富的扩展页 | 装备 | [equipment](https://www.halo.run/store/apps/app-ytygyqml) | /equipments | | 足迹 | [footprint](https://www.halo.run/store/apps/app-XCtAQ) | /footprints | | Steam | [steam](https://www.halo.run/store/apps/app-0ojqyzfh) | /steam | +| 记得 | [plugin-important-dates](https://github.com/yyliucha/plugin-important-dates) | /important-dates | ## 豆瓣页面 [豆瓣插件](https://www.halo.run/store/apps/app-srBOL) @@ -36,6 +37,18 @@ WarmIsland 主题深度集成了多款 Halo 插件,提供了丰富的扩展页 - 徽章展示 - 最近游戏 +## 记得页面 + +[记得插件](https://github.com/yyliucha/plugin-important-dates) +记录重要的日子、牵挂的人与座驾,「生活 / 爱车」双视图展示: + +- 重要日期(含农历)与倒计时便签 +- 牵挂的人:大头贴、昵称、关系与生日倒计时 +- 座驾:脱敏车牌、到期事项徽章、车主与驾驶人 +- 相册:点击车辆封面全屏只读浏览 + +详见 [记得页面](/pages/important-dates)。 + ::: info 扩展页面需要安装对应的 Halo 插件才能使用。如果插件未安装,页面会显示友好的提示信息。 ::: diff --git a/docs/pages/important-dates.md b/docs/pages/important-dates.md new file mode 100644 index 0000000..9c69765 --- /dev/null +++ b/docs/pages/important-dates.md @@ -0,0 +1,55 @@ +# 记得页面 + +`/important-dates` 由 [plugin-important-dates](https://github.com/yyliucha/plugin-important-dates) 插件提供路由,主题提供同名模板 `templates/important-dates.html` 覆盖插件默认样式,使页面完全融入 WarmIsland 的外观(导航、页脚、暗色模式)。 + +## 页面结构 + +``` +记得(标题 + 副标题 + 强调线) +├─ 生活 / 爱车 视图切换(插件开启「前台爱车模块」时出现) +├─ 到期提醒横幅(生活:重要日期;爱车:保险 / 年检 / 保养) +├─ 生活视图 +│ ├─ 重要日期(便签卡片:倒计时、日期、农历标记、关联的人) +│ └─ 牵挂的人(大头贴、昵称、关系、脱敏生日与倒计时) +└─ 爱车视图 + ├─ 我的爱车(封面、分类品牌、脱敏车牌、到期徽章、车主/驾驶人) + └─ 车主与驾驶人 / 其他重要的人 +``` + +## 交互 + +- **视图切换**:点击「生活 / 爱车」即时切换,地址栏记忆 `?view=car` +- **相册**:点击车辆封面全屏浏览相册(只读),`Esc` 或点击空白处关闭;未上传照片时给出轻提示 +- **忽略提醒**:横幅右侧 ✕ 表示「本次到期周期内不再提示」,记录在浏览器本地,到期日变化后自动恢复 + +## 模板覆盖机制 + +插件通过 Halo 的 `TemplateNameResolver` 解析模板名: + +1. 主题存在 `templates/important-dates.html` → 使用主题模板 +2. 否则回退插件自带默认模板(会用主题的 `layout.html` 页面布局契约) + +删除主题内的 `important-dates.html` 即可回到插件默认样式;插件不会写入或修改任何主题文件。 + +## 可用模板变量 + +| 变量 | 说明 | +| --- | --- | +| `title` | 页面标题(插件默认「记得」) | +| `dates` / `people` | 重要日期、人员列表 | +| `reminders` | 即将到来的重要日期(提醒横幅) | +| `cars` / `carEvents` | 座驾列表、即将到期的座驾事项 | +| `carPeople` / `otherPeople` / `personCars` | 车主驾驶人、其他人员、人员与车辆关系 | +| `showCarSection` / `carSkinEnabled` / `showAvatar` / `showImportantTag` | 各展示开关 | +| `allowDismiss` | 是否允许逐条忽略提醒 | + +## 注意事项 + +::: warning +`PersonVo` 没有 `gender` 字段,自定义模板时不要写 `${p.gender}`,否则会触发 SpEL `EL1008E` 导致页面 500。 +::: + +## 相关页面 + +- [记得配置](/config/important-dates) — 页面标题与副标题 +- [扩展页面](/pages/extended) — 其它插件扩展页面 diff --git a/package.json b/package.json index 2cae1b2..eaa4ba5 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.9", + "version": "1.1.10", "type": "module", "engines": { "node": ">=22.12.0" diff --git a/settings.yaml b/settings.yaml index f4e790d..4a45cbe 100644 --- a/settings.yaml +++ b/settings.yaml @@ -664,6 +664,18 @@ spec: name: weread_page_subtitle label: 页面副标题 placeholder: "来自微信读书的同步藏书" + - group: important_dates + label: 记得 + formSchema: + - $formkit: text + name: idates_page_title + label: 页面标题 + placeholder: "记得" + help: 对应「记得」插件的前台页面 /important-dates;留空时使用插件自带的标题 + - $formkit: text + name: idates_page_subtitle + label: 页面副标题 + placeholder: "记着重要的日子、惦记的人,还有陪你跑的爱车" - group: messageboard label: 留言板 formSchema: diff --git a/src/pages/important-dates.astro b/src/pages/important-dates.astro new file mode 100644 index 0000000..18a57b9 --- /dev/null +++ b/src/pages/important-dates.astro @@ -0,0 +1,1360 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + + + + + + +
+
+
+

+ 记得 +

+

+ 记着重要的日子、惦记的人,还有陪你跑的爱车 +

+ +
+ +
+
+ + +
+
+ + +
+
+ + 「结婚纪念日」明天就到啦~ + 「结婚纪念日」还有 3 天就到啦~ + + +
+
+ + +
+
+ + 「小白」的交强险还有 7 天到期 + 「小白」的交强险还有 7 天到期 + + +
+
+ + + +
+
+

我的爱车

+ 0 +
+ +

+ 还没有添加座驾,去插件后台「座驾」里加一辆吧~ +

+ +
+
+
+ + + +
+

+ 小白 +

+

+ SUV + · 比亚迪 + 汉 EV +

+

+ 车牌 粤B·****5 +

+
+
+ +
+ + 交强险 + · 已过期 5 天 + · 7 天后 + +
+ +
+ 共同使用 + 车主 孙铭 + 驾驶人 宁琪儿 +
+
+
+
+
+ + +
+
+

重要日期

+ 0 +
+ +

+ 还没有记录重要的日子,去插件后台加一个吧~ +

+ +
+
+
+ 35 + 天后 +
+

+ + 结婚纪念日 +

+

+ 2021-10-02 + 农历 +

+

+ ❤ 老婆 +

+
+
+
+ + +
+
+

牵挂的人

+ 0 +
+ +

+ 还没有添加你惦记的人~ +

+ +
+
+
+ + 老 + + +
+

+ 老婆 + (配偶) +

+

+ 昵称:三哥 +

+
+
+
+ + 生日 1999-10-** + (2026-10-**) + + 61 天后 +
+
+
+
+ + + +
+
+

+ 车主与驾驶人 +

+ 0 +
+ +

+ 还没给爱车配车主,去插件后台「座驾」里选一位吧~ +

+ +
+
+
+ + 老 + + +
+

+ 老婆 + (配偶) +

+

+ 昵称:三哥 +

+
+
+
+ 🚗 车主 · 小白 +
+
+
+ + +
+

+ 其他重要的人 +

+ 0 +
+
+
+
+ + 张 + + +
+

+ 张三 + (朋友) +

+

+ 昵称:三哥 +

+
+
+
+
+
+
+
+
+ + + + +
+
+ + +
+ + diff --git a/theme.yaml b/theme.yaml index 0749758..6762cbc 100644 --- a/theme.yaml +++ b/theme.yaml @@ -28,7 +28,7 @@ spec: description: 微信读书书架(依赖微信读书插件) screenshot: file: weread.html - version: "1.1.9" + version: "1.1.10" requires: ">=2.24.0" license: - name: "GPL-3.0"