Files
halo-theme-WarmIsland/theme.yaml
T
nxxy335 28b1f90b26 fix: 修复 /links 页面 500(th:attr 受限求值)并校正友链申请回执 (v1.1.11)
问题:GET /links 抛 TemplateProcessingException ——
"Instantiation of new objects and access to static classes or parameters is forbidden"
定位到 links.html 第 126 行第 978 列:
  th:attr="value=${param.value != null and !#lists.isEmpty(param.value) ? param.value[0] : ''}"
Thymeleaf 对 th:attr 走受限表达式求值,禁止表达式对象的方法调用(#lists.isEmpty 等),
且校验发生在解析阶段,运行时短路(param.value 为 null)也救不了。同样的表达式
放在 th:with 里是合法的 —— 这正是本主题其他页面的既有写法。

修复:
- 全部取值逻辑移入 th:with(采用主题已验证写法 param?.x + x.length > 0 ? x[0] : null),
  输出改用单值属性 th:value,彻底不在 th:attr 里放复杂表达式
- 校正申请回执语义:插件实际回跳参数是 applied=success|error|disabled,
  另有 message / field / value(旧版误判为 applied=true)
  - 统一单条提示:有 message 显示 message,否则成功文案
  - applied=success 用强调色,error 用红色
  - applied=disabled 时隐藏表单,保留「未开放」提示
  - field/value 回填到对应输入框(displayName / url)
- 新增 .wi-links__apply-result--ok 样式
- 版本升至 1.1.11

同时沉淀校验:新增扫描脚本检查构建产物中 th:attr 是否含 #xxx. 方法调用 / new / T() / @bean,
全主题扫描结果为 0。
2026-09-26 20:33:54 +08:00

36 lines
1.2 KiB
YAML

apiVersion: theme.halo.run/v1alpha1
kind: Theme
metadata:
name: warm-island
spec:
displayName: WarmIsland 暖屿
author:
name: 暖心向阳335
website: https://nxxy335.top/
description: 暖如灯火,静如留白。暖屿以柔和的色调和舒缓的节奏回归内容本身,为记录与阅读留出一方安静从容的角落。
logo: /themes/warm-island/assets/logo.png
homepage: https://nxxy335.top/WarmIsland/
repo: https://github.com/sunny-335/halo-theme-WarmIsland
issues: https://github.com/sunny-335/halo-theme-WarmIsland/issues
settingName: "warm-island-setting"
configMapName: "warm-island-configMap"
customTemplates:
page:
- name: MessageBoard
description: 留言板
screenshot:
file: page_messageboard.html
- name: Subscriptions
description: 订阅页面(展示博友文章订阅动态,依赖链接管理插件)
screenshot:
file: page_subscriptions.html
- name: WeRead
description: 微信读书书架(依赖微信读书插件)
screenshot:
file: weread.html
version: "1.1.11"
requires: ">=2.24.0"
license:
- name: "GPL-3.0"
url: "https://www.gnu.org/licenses/gpl-3.0.en.html"