Skip to content

Add section-aware docs OG images#295

Open
BrianSeong99 wants to merge 1 commit into
mainfrom
brian/section-aware-og-images
Open

Add section-aware docs OG images#295
BrianSeong99 wants to merge 1 commit into
mainfrom
brian/section-aware-og-images

Conversation

@BrianSeong99
Copy link
Copy Markdown
Contributor

Summary

Adds section-aware Open Graph / Twitter preview images for docs pages so shared links keep page-specific title/description metadata while showing a useful section image instead of the same global fallback everywhere.

Closes #294.

What changed

  • Adds a central route-to-OG-image mapper for current, /next, and versioned docs paths.
  • Overrides DocItem/Metadata so normal docs pages use explicit frontmatter images when present, otherwise inherit the nearest section image.
  • Overrides DocCategoryGeneratedIndexPage so generated category pages also get section images.
  • Adds 39 generated 1200x630 PNG assets under static/img/og/.
  • Adds npm run generate:og to regenerate the image set from a single script.
  • Updates the global site fallback image to img/og/miden-docs.png.

Verification

  • npm run generate:og
  • git diff --check
  • Verified every mapped image exists under static/img/og/
  • NODE_OPTIONS=--max-old-space-size=12288 npm run build after local deploy-style ingestion of external docs
  • Checked built metadata for:
    • /next/builder/tools/clients/react-sdk/query-hooks/ → page title/description + react-sdk.png
    • /builder/tools/clients/react-sdk/query-hooks/ → page title/description + react-sdk.png
    • /builder/smart-contracts/accounts/ → generated category title + smart-contract-accounts.png
    • /next/builder/tools/note-transport/users/ → page title/description + note-transport.png

Notes

The full build still reports existing broken-link, broken-anchor, KaTeX, and Browserslist warnings unrelated to this change. npm run typecheck also still reports pre-existing Docusaurus alias/type errors in swizzled and versioned theme files; the new files do not appear in the filtered typecheck output.

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.

Add section-aware OG images for docs previews

1 participant