diff --git a/astro.config.mjs b/astro.config.mjs index 333fcc6..76100d4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -52,5 +52,25 @@ export default defineConfig({ ], }, }, + /* 特殊标题:拉丁钢笔手写(比 Caveat 更干净好看) */ + { + provider: fontProviders.google(), + name: 'Nanum Pen Script', + cssVariable: '--font-hand-latin', + weights: [400], + styles: ['normal'], + subsets: ['latin'], + fallbacks: ['"Segoe Print"', 'cursive'], + }, + /* 特殊标题:中文行书手写(志莽行,飘逸美观) */ + { + provider: fontProviders.google(), + name: 'Zhi Mang Xing', + cssVariable: '--font-hand-zh', + weights: [400], + styles: ['normal'], + subsets: ['chinese-simplified', 'latin'], + fallbacks: ['"KaiTi"', '"STKaiti"', 'cursive'], + }, ], }); diff --git a/public/apple-touch-icon.jpg b/public/apple-touch-icon.jpg new file mode 100644 index 0000000..a36f56a Binary files /dev/null and b/public/apple-touch-icon.jpg differ diff --git a/public/icon-512.jpg b/public/icon-512.jpg new file mode 100644 index 0000000..a36f56a Binary files /dev/null and b/public/icon-512.jpg differ diff --git a/public/logo.jpg b/public/logo.jpg new file mode 100644 index 0000000..a36f56a Binary files /dev/null and b/public/logo.jpg differ diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 0845b90..887b700 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -3,7 +3,7 @@ import '../styles/global.css'; import '../styles/board.css'; import type { ImageMetadata } from 'astro'; import { Font } from 'astro:assets'; -import { SITE_TITLE } from '../consts'; +import { SITE_TITLE, SITE_TITLE_SUFFIX } from '../consts'; interface Props { title: string; @@ -13,16 +13,22 @@ interface Props { const canonicalURL = new URL(Astro.url.pathname, Astro.site); const { title, description, image } = Astro.props; -const fullTitle = - title === SITE_TITLE || title.endsWith(` · ${SITE_TITLE}`) - ? title - : `${title} · ${SITE_TITLE}`; +const fullTitle = (() => { + const t = (title || '').trim(); + if (!t || t === SITE_TITLE) return `${SITE_TITLE} · ${SITE_TITLE_SUFFIX}`; + if (t === SITE_TITLE_SUFFIX || t.endsWith(` · ${SITE_TITLE_SUFFIX}`)) return t; + // 兼容旧写法里已带站名的标题 + if (t.endsWith(` · ${SITE_TITLE}`)) { + return `${t.slice(0, -(` · ${SITE_TITLE}`).length)} · ${SITE_TITLE_SUFFIX}`; + } + return `${t} · ${SITE_TITLE_SUFFIX}`; +})(); --- - - + + + + diff --git a/src/components/Header.astro b/src/components/Header.astro index a0b052a..6026f6f 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,11 +1,11 @@ --- -import { SITE_TITLE } from '../consts'; +import { SITE_BRAND } from '../consts'; import HeaderLink from './HeaderLink.astro'; ---