diff --git a/src/components/pages/GalleryPage.astro b/src/components/pages/GalleryPage.astro index d6de018..da37171 100644 --- a/src/components/pages/GalleryPage.astro +++ b/src/components/pages/GalleryPage.astro @@ -5,6 +5,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro'; import { t } from '../../i18n/ui'; import type { Locale } from '../../lib/locale'; import type { PhotoExif } from '../../lib/exif'; +import { renderRich } from '../../lib/site-content'; // /en/ 侧由 T4 薄页传 locale='en';zh 路由无人传参,默认 zh 零回归 interface Props { @@ -54,7 +55,10 @@ const cards = await Promise.all( return { group: photo.data.group, title: photo.data.title, + // caption 支持 markdown + 排版类(字体/颜色):与全站文案同一条净化管线, + // 因此灯箱右侧文字也能换字体、换颜色(2026-11-02 用户要求) caption: photo.data.caption ?? '', + captionHtml: photo.data.caption ? await renderRich(photo.data.caption) : '', alt: photo.data.alt ?? photo.data.title, image: photo.data.image, exif: formatExif(photo.data.exif), @@ -97,6 +101,7 @@ const first = cards[0]; class="shot-btn" data-title={card.title} data-caption={card.caption} + data-caption-html={card.captionHtml} data-exif={card.exif} data-full={card.fullSrc} data-original={card.original} @@ -143,7 +148,8 @@ const first = cards[0];