Skip to content

fix: add Open Graph and Twitter Card metadata to all pages - closes #2691 - #2692

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

fix: add Open Graph and Twitter Card metadata to all pages - closes #2691#2692
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/og-metadata-2691-dc78b8c6348a0760

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Problem

Rules pages emitted zero Open Graph or Twitter Card meta tags, so shared links on Teams, Slack, LinkedIn, X, and Facebook showed no preview image — just a bare title and URL. This was a regression from the Gatsby → Next.js migration.

Changes

app/layout.tsx

  • Added metadataBase: new URL("(www.ssw.com.au/redacted)") so Next.js can resolve relative URLs in metadata
  • Added default openGraph block with the SSW default OG image (1200×630 from Tina CDN), siteName, type, and url
  • Added twitter block with card: "summary_large_image", site, and creator (using @SSW_TV from site-config)
  • Imported siteTitle, siteDescription, siteUrl, social from @/site-config to avoid duplication with hardcoded strings

These defaults are inherited by every route (latest-rules, search, user, archived, etc.) with no further changes needed.

app/[filename]/page.tsx

  • In generateMetadata(), added per-page openGraph override for categories (type: "website") and rules (type: "article") with page-specific title, description, and url
  • Refactored the category/rule metadata to compute description and canonicalUrl once and reuse them in both the base metadata and the openGraph block

Result

Every page now emits:

  • og:title, og:description, og:type, og:site_name, og:url, og:image
  • twitter:card, twitter:site, twitter:creator

Rule and category pages additionally get correct per-page og:title, og:description, and og:url.

Notes

Closes #2691

Generated by Issue Triage for issue #2691 · ● 738.4K ·

…2691

- Add metadataBase, default openGraph, and twitter to app/layout.tsx so
  every route inherits OG image and Twitter Card metadata
- Use SSW default OG image (1200x630) from Tina CDN
- Import siteTitle, siteDescription, siteUrl, social from site-config
  to avoid duplication
- Override openGraph title/description/url per-page in generateMetadata()
  for rules (type: article) and categories (type: website)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added Area: Frontend Relates to frontend development e.g. Angular, React, XAML etc seo Type: Bug A problem with existing functionality labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Frontend Relates to frontend development e.g. Angular, React, XAML etc seo Type: Bug A problem with existing functionality

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