Skip to content

feat(seo): add canonical link tags and Open Graph meta tags - #444

Open
anishkb-dev wants to merge 1 commit into
CivicDataLab:devfrom
anishkb-dev:fix/canonical-and-og-metadata-364-370
Open

feat(seo): add canonical link tags and Open Graph meta tags#444
anishkb-dev wants to merge 1 commit into
CivicDataLab:devfrom
anishkb-dev:fix/canonical-and-og-metadata-364-370

Conversation

@anishkb-dev

@anishkb-dev anishkb-dev commented Jul 31, 2026

Copy link
Copy Markdown

Fixes #364

Adds root metadata in app/layout.tsx: metadataBase, a canonical URL via alternates.canonical: './', Open Graph and Twitter Card tags, and a %s | ParakhAI title template so child routes inherit the suffix. app/[locale]/dashboard/layout.tsx drops its hardcoded | ParakhAI since the template now appends it — otherwise the tab would read Dashboard | ParakhAI | ParakhAI.

Verified against the built HTML rather than just typechecking:

/           <link rel="canonical" href="https://parakh.civicdatalab.in"/>
/dashboard  <link rel="canonical" href="https://parakh.civicdatalab.in/dashboard"/>
            og:title, og:description, og:url, og:locale, og:type
            twitter:card=summary, twitter:title, twitter:description

Two decisions worth flagging, both open to correction:

No og:image, so this only closes #364 and not #370. The repo has no image at the 1200x630 that link previews want — the closest is Favicon.svg (an SVG, which X, Facebook, LinkedIn and Slack won't render for previews) and parakhai-logo.png at 169x52. I'd rather ship the tags that work than point og:image at an asset that produces a broken preview and declare dimensions the file doesn't have. The Twitter card is summary rather than summary_large_image for the same reason — summary_large_image without a usable image degrades badly. Adding a proper social card image would finish #370, but that's an asset someone needs to design, not a code change.

The site URL reads NEXT_PUBLIC_PLATFORM_URL, which is already declared in env.ts and currently unused, rather than introducing a new variable. It's read from process.env directly with a production fallback instead of going through env.ts, because env.ts defaults it to http://localhost:3000 and the deploy workflow doesn't set it — going through the schema would emit localhost canonical URLs in production. If you'd rather set the variable in the deploy vars, I'm happy to switch it to the validated env export instead.

@anishkb-dev
anishkb-dev force-pushed the fix/canonical-and-og-metadata-364-370 branch from e6752ae to 237a68b Compare August 8, 2026 07:46
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