diff --git a/content/site/pages.yaml b/content/site/pages.yaml new file mode 100644 index 0000000..d8f2a8f --- /dev/null +++ b/content/site/pages.yaml @@ -0,0 +1,21 @@ +# 页面标题下的说明文案(瞬间 / 书架):文字、字号、颜色、字体都在这里改。 +# 缺省即回落内置默认,删字段不会破版。 +# 说明:color 取 tokens 里的灰阶层级(ink-1..ink-4);font 取排版类白名单里的字体类。 + +moments: + note: + zh: 零碎的记录:随手拍、一句话感想、开源动态。 + en: 'Fragmented notes: casual shots, one-liners, and open-source updates.' + style: + size: 13 + color: ink-4 + font: font-sans + +books: + note: + zh: 点一行展开封面与简介 · 置顶的书默认展开 + en: 'Tap a row for the cover and blurb · pinned books start open' + style: + size: 13 + color: ink-4 + font: font-sans # 与改造前一致;想用楷体改成 font-kai diff --git a/src/components/pages/BooksPage.astro b/src/components/pages/BooksPage.astro index c141edb..5d50249 100644 --- a/src/components/pages/BooksPage.astro +++ b/src/components/pages/BooksPage.astro @@ -18,11 +18,14 @@ import BaseLayout from '../../layouts/BaseLayout.astro'; import { t } from '../../i18n/ui'; import type { Locale } from '../../lib/locale'; import { sortPosts } from '../../lib/post-order'; +import { pageNote } from '../../lib/site-content'; interface Props { locale?: Locale; } const { locale = 'zh' } = Astro.props; +// 标题下说明:文字与样式都可后台改(白名单校验,非法值回落) +const note = await pageNote('books', locale); const books = sortPosts( await getCollection( @@ -58,10 +61,6 @@ const pinnedCount = items.filter((i) => i.pinned).length; const L = { shelf: t('books_title', locale), count: locale === 'zh' ? `${items.length} 本` : `${items.length} books`, - note: - locale === 'zh' - ? '点一行展开封面与简介 · 置顶的书默认展开' - : 'Tap a row for the cover and blurb · pinned books start open', read: locale === 'zh' ? '读这篇书评 →' : 'Read the review →', pinned: t('pinned_label', locale), expand: locale === 'zh' ? '展开封面与简介' : 'Expand cover and blurb', @@ -77,7 +76,8 @@ const L = { {L.shelf}{L.count} {pinnedCount > 0 && {pinnedCount} {L.pinned}} -
{L.note}
+ +{t('moments_note', locale)}
+ +