Skip to content

feat(docs): shared og:image + per-page og:title from H1#269

Merged
ronaldtse merged 1 commit into
v5from
fix/og-image-and-per-page-title
Jun 18, 2026
Merged

feat(docs): shared og:image + per-page og:title from H1#269
ronaldtse merged 1 commit into
v5from
fix/og-image-and-per-page-title

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Two small SEO consistency fixes for the formulas subsite, aligning it with fontist.org and the other subsites.

Changes

1. og:image → shared PNG

https://www.fontist.org/formulas/logo-full.svghttps://www.fontist.org/og-image.png

The SVG was subsite-local and SVG has poor support on Twitter/Facebook/LinkedIn. The PNG is the shared social card already used across fontist.org, fontist, and fontisan.

2. Per-page og:title from H1 (not just frontmatter)

transformHead was using pageData.frontmatter.title || "Fontist Formulas". Most formulas pages (guide, browse, formula pages) have no frontmatter title, so every page showed the site-wide "Fontist Formulas" as its og:title.

Changed the fallback to pageData.title — VitePress's resolved title (frontmatter.title || first H1). Now og:title reflects the actual page.

Page Before After
/guide/ Fontist Formulas Fontist Formulas Guide
/browse/<formula>/ Fontist Formulas Mitimasu - Fontist Formula (etc.)

Verification (local build, prod env)

BASE_PATH=/formulas/ SITE_URL=https://www.fontist.org npm run build → 4323 pages built. Confirmed in dist:

  • dist/guide/index.html: og:title="Fontist Formulas Guide", og:image="https://www.fontist.org/og-image.png", og:url="https://www.fontist.org/formulas/guide/".
  • dist/index.html: og:image="https://www.fontist.org/og-image.png".
  • A formula browse page: og:title="Mitimasu - Fontist Formula".

Scope

Two-line change to docs/.vitepress/config.ts. No routing, build, or content changes — formulas already had directory-style URLs, sitemap, and transformHead; this just corrects the og:image source and the og:title fallback.

- 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".
@ronaldtse ronaldtse merged commit fa3f142 into v5 Jun 18, 2026
9 of 10 checks passed
@ronaldtse ronaldtse deleted the fix/og-image-and-per-page-title branch June 18, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant