Skip to content

Add og:image preview cards to docs pages #237

Open

Description

@thzgajendra

Summary

Docs pages have no og:image, so links shared on LinkedIn, X or Slack show no preview card.

Current behavior

Sharing a docs URL produces a plain link with no image.

Expected behavior

Shared docs links show a preview card with an image, title and description.

Proposed solution

  • Add a default og:image (branded, 1200x630) to all docs pages.
  • Optionally generate per-page images from the page title.
  • Add twitter:card (summary_large_image), og:image:width, og:image:height and og:image:alt.

Acceptance criteria

  • A docs page URL shows a preview card in the LinkedIn Post Inspector and the X/Twitter card validator.
  • Image has alt text and correct dimensions.

Additional context

Found in an audit of gofr.dev AI readiness and discoverability on 2026-10-07.

Activity

  1. adamshatzkamer commented on Oct 9, 2026

    @adamshatzkamer

    Implemented via PR #242 — docs pages now attach the site default social card to their openGraph/twitter metadata.

    Root cause: docs pages that set nextjs.metadata.title/description in frontmatter emit their own openGraph/twitter object, and Next's metadata merge replaces the root layout's images — so /docs/ (and other frontmatter docs pages) lost og:image entirely while pages without frontmatter kept it.

    Fix: the markdoc loader now attaches /opengraph-image.png (1200×630 with og:image:alt) to any page-level openGraph/twitter it emits, unless the page author explicitly sets custom images. Verified with a Next build reproducing the metadata pipeline: /docs/ emits og:image 1200×630 + og:image:alt + twitter:image, and no-frontmatter pages still inherit the root layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions