Skip to content

fix(layout): set Fastify logo as og:image for social shares - #486

Merged
ilteoood merged 1 commit into
mainfrom
fix/og-image-fastify-logo
Aug 19, 2026
Merged

fix(layout): set Fastify logo as og:image for social shares#486
ilteoood merged 1 commit into
mainfrom
fix/og-image-fastify-logo

Conversation

@ilteoood

@ilteoood ilteoood commented Aug 19, 2026

Copy link
Copy Markdown
Member

Without `og:image` meta tags, social-media crawlers scrape the page for any icon and end up picking a random inline one. This now ships a 1200×630 PNG card backed by the Fastify logo, plus the cross-platform favicon fallbacks and webmanifest the OG/SEO audit expects.

Assets (all derived from `public/favicon.svg` via `scripts/generate-og-assets.mjs`):

  • `public/og-image.png` — 1200×630, logo on `#0a0b0d`
  • `public/favicon.ico` — real 32×32 ICO container (not a PNG renamed)
  • `public/favicon-32x32.png` — 32×32
  • `public/apple-touch-icon.png` — 180×180
  • `public/site.webmanifest` — PWA / Add-to-Home-Screen metadata

`BaseLayout.astro` now declares everything the audit was missing:

  • `og:image` (and width/height) → `og-image.png` instead of the 200×200 favicon
  • `og:url`, `og:site_name`, `og:locale`, `og:image:alt`
  • `twitter:card=summary_large_image`, `twitter:site=@fastifyjs` (handle from footer link to x.com/fastifyjs)
  • ``, apple-touch-icon, .ico + 32×32 favicon fallbacks
  • minimal `WebSite` JSON-LD block

`biome check` and `astro check` are clean. The Astro hints listed in the audit's `npm run check` output all predate this change.

Crawlers fell back to scraping a random inline icon from the page
because BaseLayout only declared og:title and og:description. Add a
proper 1200x630 OG card backed by the existing favicon logo, plus the
favicon variants and webmanifest the audit (Google, X, LinkedIn,
WhatsApp, Slack, iOS home screen) expect.

- public/og-image.png (1200x630, logo on dark background) — declared
  as og:image, twitter:image and in the webmanifest
- public/favicon.ico (32x32, real ICO container), favicon-32x32.png,
  apple-touch-icon.png (180x180) — cross-platform favicon fallbacks
- public/site.webmanifest — PWA / 'Add to Home Screen' metadata
- BaseLayout: og:url, og:image:alt, og:site_name, og:locale,
  twitter:card=summary_large_image, twitter:site=@fastifyjs, the new
  link tags, and a minimal WebSite JSON-LD block.

Assets are committed; scripts/generate-og-assets.mjs regenerates them
from public/favicon.svg via sharp (already a transitive dep).
@ilteoood
ilteoood merged commit 7fdc39c into main Aug 19, 2026
5 checks passed
@ilteoood
ilteoood deleted the fix/og-image-fastify-logo branch August 19, 2026 13:27
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.

2 participants