Skip to content

fix: add Open Graph and Twitter Card metadata - closes #2698 - #2699

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/og-metadata-2698-feccfab5b3cc0bd0
Draft

fix: add Open Graph and Twitter Card metadata - closes #2698#2699
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/og-metadata-2698-feccfab5b3cc0bd0

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements Phase 1 of the Open Graph metadata fix from #2698. Every SSW Rules page previously emitted zero OG/Twitter meta tags — this PR wires up the full set using Next.js's Metadata API.

Changes

app/layout.tsx

  • Added metadataBase: new URL(siteUrl) so Next.js can resolve relative image URLs correctly
  • Added default openGraph block: title, description, url, siteName, type: "website", and a default image at ${siteUrl}/og-image.jpg
  • Added default twitter block: card: "summary_large_image", site, creator (from social.twitter in site-config)
  • Imported siteDescription, siteTitle, and social from @/site-config to keep values DRY

app/[filename]/page.tsx

  • Updated generateMetadata() to include openGraph and twitter overrides for each page type:
    • Category pages: type: "website", page-specific title, description, and canonical URL
    • Rule pages: type: "article", page-specific title, description, and canonical URL
  • Description fallback chain preserved: seoDescription → body preview → site default

⚠️ Prerequisite: OG image file

The metadata references public/og-image.jpg (resolves to `(www.ssw.com.au/redacted) This file does not yet exist — it needs to be created as a 1200×630 JPEG by the design team. Until then, social previews will show the OG title/description but the image will be broken.

This matches the Phase 1 task checklist in #2698:

  • Add metadataBase and default openGraph + twitter to app/layout.tsx
  • Override per-page openGraph in the generateMetadata() functions (rules + categories)
  • Get a default SSW Rules OG image (1200×630) → place as public/og-image.jpg
  • Verify with an OG debugger and a real paste into Teams

Related Issues

Generated by Issue Triage for issue #2698 · ● 876.7K ·

…2698

Phase 1 of fixing missing OG metadata:
- Add metadataBase, default openGraph, and twitter to app/layout.tsx
  so every route inherits OG title, description, image, and Twitter card
- Override openGraph/twitter per-page in app/[filename]/page.tsx
  for both rule pages (type: article) and category pages (type: website)
- Import siteDescription, siteTitle, social from site-config for DRY defaults

Note: public/og-image.jpg (1200x630) must be added before the OG image
renders. See Phase 1 task checklist in #2698.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

🐛 Rules pages have no Open Graph image - shared links show no preview

0 participants