fix: add Open Graph and Twitter Card metadata to all pages - closes #2691 - #2692
Draft
github-actions[bot] wants to merge 1 commit into
Draft
fix: add Open Graph and Twitter Card metadata to all pages - closes #2691#2692github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…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>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsxmetadataBase: new URL("(www.ssw.com.au/redacted)")so Next.js can resolve relative URLs in metadataopenGraphblock with the SSW default OG image (1200×630 from Tina CDN),siteName,type, andurltwitterblock withcard: "summary_large_image",site, andcreator(using@SSW_TVfromsite-config)siteTitle,siteDescription,siteUrl,socialfrom@/site-configto avoid duplication with hardcoded stringsThese defaults are inherited by every route (latest-rules, search, user, archived, etc.) with no further changes needed.
app/[filename]/page.tsxgenerateMetadata(), added per-pageopenGraphoverride for categories (type: "website") and rules (type: "article") with page-specifictitle,description, andurldescriptionandcanonicalUrlonce and reuse them in both the base metadata and theopenGraphblockResult
Every page now emits:
og:title,og:description,og:type,og:site_name,og:url,og:imagetwitter:card,twitter:site,twitter:creatorRule and category pages additionally get correct per-page
og:title,og:description, andog:url.Notes
Closes #2691