feat: 图库重做/瞬间详情/重要日子适配页/全站灯箱,修复豆瓣页白屏(v0.2.0)

- 图库页重做:首屏按相册分组展示,封面自动取相册第一张图,可在设置中按相册手动配置封面;点击相册进入 ?group= 瀑布流视图(一行三张、页面加宽),支持预览模式(lightgallery 放大,默认值可配置、前台可切换)
- 瞬间页:新增 /moments/{name} 详情页(完整内容、媒体、标签、作者信息、评论区);列表页发布人与发布时间同行对齐;补充单条标签
- 新增 plugin-important-dates 适配页 important-dates.html(即将到来提醒、全部日期倒计时、重要标记、人员生日)
- 全站集成 lightgallery.js 灯箱(动态模式、按需加载、挂载 body 避免层叠上下文遮挡),可在设置中关闭
- 友链页:「全部」视图按分组展示并显示分组标题(空分组自动隐藏);卡片简介限制两行,统一卡片高度与尺寸
- 修复 /douban 白屏:SpEL 不支持 th:with 中的嵌套 map 字面量(EL1041E),改为四段显式区块
- 版本号升至 0.2.0;README 同步更新

Co-Authored-By: WorkBuddy <noreply@workbuddy.ai>
This commit is contained in:
2026-09-30 09:10:32 +08:00
co-authored by WorkBuddy
parent c0ea6ec0df
commit 4e3001674a
17 changed files with 1125 additions and 160 deletions
+185
View File
@@ -0,0 +1,185 @@
<include src="partials/layout.html">
<template name="head">
<title th:text="|${title} - ${site.title}|">瞬间</title>
<style>
.moment-detail {
max-width: 46rem;
margin: 0 auto;
}
.moment-back {
display: inline-block;
margin-bottom: 1.5rem;
color: var(--color-link);
font-size: 0.9rem;
}
.moment-back:hover {
color: var(--color-link-hover);
}
.moment-card {
padding: 1.5rem 0;
}
.moment-card header {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem;
margin-bottom: 1rem;
color: var(--color-text-secondary);
}
.moment-owner {
display: inline-flex;
align-items: center;
gap: 0.6rem;
}
.moment-owner img {
width: 2.5rem;
height: 2.5rem;
border-radius: 50%;
object-fit: cover;
}
.moment-owner-info {
display: flex;
flex-direction: column;
line-height: 1.3;
}
.moment-owner-name {
color: var(--color-text);
font-weight: 600;
}
.moment-owner-bio {
font-size: 0.8rem;
color: var(--color-text-muted);
}
.moment-meta {
display: inline-flex;
align-items: center;
gap: 0.75rem;
font-size: 0.85rem;
}
.moment-meta a {
color: var(--color-link);
}
.moment-tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-bottom: 1rem;
font-size: 0.85rem;
}
.moment-tags a {
color: var(--color-link);
}
.moment-media img,
.moment-media video {
display: block;
max-width: 100%;
height: auto;
margin-top: 1rem;
border-radius: var(--radius-md);
}
.moment-media audio {
width: 100%;
margin-top: 1rem;
}
.comments-section {
margin-top: 2rem;
padding-top: 1.5rem;
border-top: 1px solid var(--color-border);
}
</style>
</template>
<div class="container">
<section class="moment-detail" th:if="${moment != null}">
<a class="moment-back" th:href="@{/moments}" th:text="#{moment.back_to_list}"
>返回瞬间列表</a
>
<article class="moment-card" th:with="content=${moment.spec.content}">
<header>
<span class="moment-owner" th:if="${moment.owner != null}">
<img
th:if="${not #strings.isEmpty(moment.owner.avatar)}"
th:src="${moment.owner.avatar}"
th:alt="${moment.owner.displayName}"
loading="lazy"
/>
<span class="moment-owner-info">
<span
class="moment-owner-name"
th:text="${moment.owner.displayName}"
>用户名</span
>
<span
class="moment-owner-bio"
th:if="${not #strings.isEmpty(moment.owner.bio)}"
th:text="${moment.owner.bio}"
></span>
</span>
</span>
<span class="moment-meta">
<time
th:if="${moment.spec.releaseTime != null}"
th:datetime="${moment.spec.releaseTime}"
th:text="${#temporals.format(moment.spec.releaseTime, 'yyyy-MM-dd HH:mm')}"
>发布时间</time
>
</span>
</header>
<div
class="moment-tags"
th:if="${not #lists.isEmpty(moment.spec.tags)}"
>
<a
th:each="tag : ${moment.spec.tags}"
th:href="@{/moments(tag=${tag})}"
th:text="'#' + ${tag}"
></a>
</div>
<div
class="article-content"
th:if="${not #strings.isEmpty(content.html)}"
th:attr="data-lightbox=${theme.config?.basic?.enable_lightbox != false ? 'true' : null}"
th:utext="${content.html}"
></div>
<div
class="moment-media"
th:attr="data-lightbox=${theme.config?.basic?.enable_lightbox != false ? 'true' : null}"
th:if="${not #lists.isEmpty(content.medium)}"
>
<th:block th:each="medium : ${content.medium}">
<img
th:if="${medium.type.name == 'PHOTO'}"
th:src="${medium.url}"
alt="瞬间图片"
loading="lazy"
/>
<video
th:if="${medium.type.name == 'VIDEO'}"
th:src="${medium.url}"
controls
></video>
<audio
th:if="${medium.type.name == 'AUDIO'}"
th:src="${medium.url}"
controls
></audio>
</th:block>
</div>
</article>
<div class="comments-section" th:if="${haloCommentEnabled}">
<halo:comment
group="moment.halo.run"
kind="Moment"
th:attr="name=${moment.metadata.name}"
/>
</div>
</section>
<p th:if="${moment == null}">瞬间不存在或不可见。</p>
</div>
</include>