From 949a64d5d1af821b731ad736534fbb496342dfb7 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Thu, 18 Jun 2026 12:50:59 +0800 Subject: [PATCH] feat(docs): use shared og:image + per-page og:title from H1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - og:image: switch from `logo-full.svg` (subsite-local SVG) to `/og-image.png` — the shared social card used across fontist.org and all subsites. PNG renders reliably on Twitter/Facebook/LinkedIn; SVG does not. - transformHead: fall back to `pageData.title` (VitePress's resolved title = frontmatter.title || first H1) instead of only `frontmatter.title`. Most formulas pages (guide, browse) have no frontmatter title, so the previous fallback hardcoded "Fontist Formulas" on every page. Now og:title reflects the actual page — e.g. "Fontist Formulas Guide", "Mitimasu - Fontist Formula". --- docs/.vitepress/config.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 30ff7fd7..ae2c7f2c 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -94,7 +94,7 @@ export default defineConfig({ ], ["link", { rel: "manifest", href: "/site.webmanifest" }], ["meta", { property: "og:type", content: "website" }], - ["meta", { property: "og:image", content: `${SITE_BASE}logo-full.svg` }], + ["meta", { property: "og:image", content: `${SITE_ORIGIN}/og-image.png` }], ["meta", { name: "twitter:card", content: "summary_large_image" }], ], @@ -118,8 +118,7 @@ export default defineConfig({ // generic "Fontist Formulas" for every page. transformHead(context) { const pageData = context.pageData; - const title = - (pageData.frontmatter.title as string) || "Fontist Formulas"; + const title = pageData.title || "Fontist Formulas"; const description = (pageData.frontmatter.description as string) || "Searchable index of all Fontist Formulas";