Skip to content

Feat/1feat(seo): expand route-specific OG metadata62 route specific og - #167

Merged
truthixify merged 8 commits into
wraith-protocol:developfrom
Adedoyinjr:feat/162-route-specific-og
Sep 28, 2026
Merged

truthixify merged 8 commits into
wraith-protocol:developfrom
Adedoyinjr:feat/162-route-specific-og

Conversation

@Adedoyinjr

Copy link
Copy Markdown
Contributor

Summary

Expands route-specific Open Graph metadata and image generation across all indexable route families instead of limiting bot metadata handling to a small set of middleware exceptions.

What changed

  • Added a centralized route-specific OG metadata resolver.
  • Expanded middleware handling to cover all indexable routes and localized paths.
  • Added dynamic OG generation for blog posts and case studies.
  • Added route-specific OG metadata for grants, blog, and case studies.
  • Added blog manifest generation from MDX and JSON sources.
  • Added localized metadata/image handling for English and Spanish routes.
  • Added OG metadata regression tests and bot HTTP integration tests.
  • Added cache/header and dynamic URL coverage.
  • Preserved existing roadmap, Stellar, and use-case metadata behavior.

Validation

  • "og-metadata.test.ts": 47/47 passing
  • "middleware.test.ts": 35/35 passing
  • "tsc --noEmit": 0 errors
  • "npm run build": passed
  • 18 OG images generated successfully
  • Working tree is clean

The existing unrelated test failures were not introduced by this change.

Closes #162

@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

@Peolite1 is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@Adedoyinjr Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Adedoyinjr
Adedoyinjr changed the base branch from main to develop September 24, 2026 12:10
@truthixify

Copy link
Copy Markdown
Contributor

Please rebase onto develop and remove the unrelated Blog, CaseStudies, and Grants page rewrites. Also ogImageSlugFor ignores locale, so Spanish routes still use English static images. Keep this PR focused on OG metadata and generate locale-specific images or use the localized dynamic endpoint.

Introduce a robust system for generating Open Graph metadata and
social sharing images for all routes, including dynamic blog posts
and case studies.

- Add `scripts/gen-blog-manifest.mjs` to automatically generate a
  JSON manifest from MDX frontmatter during build.
- Implement `src/utils/og-metadata.ts` to centralize route metadata
  resolution, including support for localized titles and descriptions.
- Update `middleware.ts` to dynamically inject SEO meta tags into
  HTML responses for bots.
- Enhance `scripts/og.ts` to support dynamic routes from the blog
  manifest and case studies data.
- Add unit tests for middleware and metadata utility functions.
- Update build pipeline in `package.json` to include manifest
  generation.
@Adedoyinjr
Adedoyinjr force-pushed the feat/162-route-specific-og branch from 02750cf to a499437 Compare September 25, 2026 02:00
@truthixify

truthixify commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

The scope and locale slugs are fixed, but Spanish images are still rendered from the same English route config. Only the filename gets the Spanish prefix. Spanish descriptions and OG URLs also use English copy and paths. Please render localized image content, keep localized URLs, and test the generated metadata.

@truthixify

Copy link
Copy Markdown
Contributor

The latest push adds Portuguese strings, but the resolver still supports only en and es. Spanish descriptions and OG URLs also remain English. Please support Portuguese end to end and preserve the locale in descriptions, URLs, and generated images.

1 similar comment
@truthixify

Copy link
Copy Markdown
Contributor

The latest push adds Portuguese strings, but the resolver still supports only en and es. Spanish descriptions and OG URLs also remain English. Please support Portuguese end to end and preserve the locale in descriptions, URLs, and generated images.

Add an ogRoutes namespace to en/es/pt holding per-route title, description and
OG image copy, and drive both the metadata resolver and the satori generator
from that single source.

- support pt end to end: Locale, SUPPORTED_LOCALES, prefix stripping, slugs
- preserve the locale in descriptions, og:url (/pt/grants) and images (pt-*.png)
- render localized copy into es-/pt- images instead of re-rendering English
- emit og:locale pt_BR and rewrite the html lang attribute for pt
Support Portuguese end to end and preserve the locale in descriptions, URLs and
generated images.

The og.routes table only carried OG image copy and was wired for es alone, so
pt strings were never read, descriptions and og:url stayed English, and the es
images were re-rendered from the English config. Replace it with an ogRoutes
namespace holding title, description and image copy for every route in en/es/pt,
read by both the metadata resolver and the satori generator.

- Locale/SUPPORTED_LOCALES cover pt; locale prefix stripping, image slugs,
  og:locale tags and the html lang rewrite follow any supported locale
- og:url keeps the locale prefix (/pt/grants) while English stays unprefixed
- images are generated from listOgImageJobs(), so es-*/pt-* carry translated
  text instead of a localized filename over English copy
@truthixify

truthixify commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Locale handling is fixed, but indexable routes such as /chains, /ecosystem, /security, /status, /governance, /threat-model, and /use-cases/calculator are still missing. Unknown blog and case-study slugs are also treated as indexable. Please cover those routes and reject missing slugs.

- add /chains, /ecosystem, /security, /status, /governance, /threat-model and
  /use-cases/calculator to ogRoutes in en, es and pt, with matching
  ROUTE_SLUGS entries so each gets a prerendered image
- resolve static routes by exact path first so /use-cases/calculator no longer
  inherits the /use-cases card
- isIndexableRoute and resolveRouteMetadata now require the blog manifest or
  case-studies entry to exist, so unknown slugs and /blog/tag/*, /blog/author/*
  are no longer treated as indexable and receive no metadata
- extend the og-metadata and middleware suites over the new routes, their
  localized variants, and the rejected slugs
@Adedoyinjr

Copy link
Copy Markdown
Contributor Author

Addressed in 1868fa2.

Missing indexable routes — /chains, /ecosystem, /security, /status, /governance,
/threat-model and /use-cases/calculator are now in ogRoutes for en, es and pt, with
matching ROUTE_SLUGS entries so each one gets a prerendered image (build now emits
75 images across 25 routes). Static routes resolve by exact path first, so
/use-cases/calculator no longer inherits the /use-cases card.

Unknown slugs — isIndexableRoute and resolveRouteMetadata now require the slug to
exist in blog-manifest.json or case-studies.json. Unknown blog/case-study slugs
return null, so the middleware leaves the request untouched instead of emitting
metadata and a canonical URL for a page that 404s in the app. This also rejects
/blog/tag/* and /blog/author/*, which were matching the post regex.

Tests — og-metadata.test.ts now asserts indexability and image slugs for the full
static route list, plus the localized variants and the rejected slugs;
middleware.test.ts covers injected metadata, og:url and og:locale for each new route
and the untouched response for unknown slugs, tag and author routes. Also merged
develop (was one commit behind).

Dynamic routes reused the English manifest/case-study copy for every locale and
only the generated image filename carried a locale prefix. Adds an ogContent
table to the en, es and pt bundles — the dynamic equivalent of ogRoutes, keyed
by locale-independent route path — and resolves titles, descriptions and image
content through it in both resolveRouteMetadata and listOgImageJobs, so the
rendered image itself receives the localized copy.

English entries mirror the source content exactly, so English output is
unchanged; a new post or case study without ogContent entries falls back to the
source data and the parity test below fails until translations are added.
@Adedoyinjr

Copy link
Copy Markdown
Contributor Author

Implemented the remaining locale issue in "41cedde".

Dynamic "/blog/" and "/case-studies/" OG metadata now resolves localized titles, descriptions, URLs, and image content independently for "en", "es", and "pt".

I also added coverage to verify:

  • localized dynamic metadata and OG URLs
  • locale-specific image content, not just filenames
  • no silent English fallback
  • bot-served Spanish/Portuguese metadata
  • English behavior remains unchanged

All checks pass: 302 tests, build (75 images), TypeScript, a11y, i18n lint, JSON-LD validation, formatting, and "git diff --check".

The Spanish and Portuguese copy is newly written and can be adjusted if native-language review finds any wording issues.

@truthixify
truthixify merged commit de43985 into wraith-protocol:develop Sep 28, 2026
3 of 4 checks passed
@truthixify

Copy link
Copy Markdown
Contributor

Merged. The final head covers every indexable route, all three locales, generated image content, and unknown slugs. Thanks for addressing each review round carefully.

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.

[Wave 9] Expand route-specific OG generation beyond middleware exceptions

2 participants