Skip to content

Add Open Graph / social preview tags + OG image to the docs - #15195

Closed
astra-intelligence wants to merge 2 commits into
pytest-dev:mainfrom
astra-intelligence:add-og-social-preview
Closed

astra-intelligence wants to merge 2 commits into
pytest-dev:mainfrom
astra-intelligence:add-og-social-preview

Conversation

@astra-intelligence

Copy link
Copy Markdown

Add Open Graph / social preview tags + OG image to the docs

Problem

docs.pytest.org — one of the most-shared documentation sites in the Python ecosystem — has zero og:* and zero twitter:* meta tags in its <head>. Every link to the docs shared on X/Twitter, LinkedIn, Slack, Discord, or iMessage renders a blank preview card (just the URL, no title, no description, no image).

Fix

  • doc/en/_templates/page.html — a furo page.html override (via the documented {% extends "!page.html" %} + extrahead block pattern) that emits, on every page:
    • og:site_name, og:type, og:title (per-page), og:description, og:image (+ width/height)
    • twitter:card (summary_large_image), twitter:title, twitter:description, twitter:image
  • doc/en/_static/og-image.png — a 1200×630 Open Graph image (the standard social-card size), generated with a Pillow-only, reproducible script tools/make-og-image.py that composites the project's own pytest1.png logo onto a clean white card with the official tagline and section pills.

Verification

  • Local sphinx-build -b html doc/en succeeds with no warnings.
  • OG/Twitter tags confirmed present on index.html and subpages (e.g. getting-started.html), with per-page og:title.
  • The image is copied to _static/og-image.png in the built output.

This is a small, self-contained docs improvement — no runtime code changes. After merge, docs.pytest.org links will render proper rich preview cards everywhere they're shared.

Paperclip-Paperclip and others added 2 commits October 17, 2026 10:25
docs.pytest.org had zero og:* and twitter:* meta tags, so every link
shared on X/Twitter, LinkedIn, Slack, Discord, or iMessage rendered a
blank preview card.

- Add a furo page.html override (doc/en/_templates/page.html) emitting
  og:site_name/type/title/description/image(+width/height) and
  twitter:card/title/description/image on every page.
- Add a 1200x630 OG image (doc/en/_static/og-image.png) generated with
  Pillow-only tools/make-og-image.py (reproducible), using the project's
  own pytest1.png logo.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
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.

3 participants