skillfed

sphinxext-opengraph

Sphinx Extension to enable OGP support

sphinxext-opengraph v0.13.0 743.9K downloads/30d#5,175 on PyPI91
Permissive license BSD-3-Clause AGING released

What it is and what it does

sphinxext-opengraph is a Sphinx extension that injects Open Graph protocol metadata into the HTML head of each documentation page during the build process. When documentation links are shared on social platforms like Twitter, Facebook, or LinkedIn, these metadata tags control how the preview appears—including title, description, and image.

The extension integrates directly into Sphinx's build pipeline and requires only Sphinx as a runtime dependency. It supports an optional social-cards extra for generating custom preview images. The package is stable, supports Python 3.9 through 3.14, and has been in production use since 2020.

Use it for:

  • Ensure API documentation links display properly formatted previews when shared in team chat or social media.
  • Generate custom social card images for documentation pages to improve visual consistency in link previews.
  • Add structured metadata to technical documentation so search engines and social platforms extract correct titles and descriptions.
  • Automate Open Graph tag generation across a large multi-page documentation site without manual HTML editing.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Sphinx extension that automatically generates Open Graph metadata tags for documentation pages, enabling proper preview rendering when documentation links are shared on social media.

Yes. Low install friction, permissive license, no known vulnerabilities, and stable maintenance make this a safe choice for any Sphinx documentation project that needs social media preview support. The aging status reflects infrequent updates rather than abandonment—the repository is active and the extension is production-stable.

Install

sphinxext-opengraph on PyPI

pip

pip install sphinxext-opengraph

uv

uv add sphinxext-opengraph

poetry

poetry add sphinxext-opengraph

Installing sphinxext-opengraph

Before you install

Low friction install with a single runtime dependency on Sphinx. Marked as aging (350 days since last release), but the repository remains active with recent commits and is not archived, suggesting stable maintenance rather than abandonment.

License in practice

BSD-3-Clause is a permissive license with minimal restrictions; you can use this package freely in commercial and private projects with only attribution required.

Quickstart

pip install sphinxext-opengraph

# In conf.py:
extensions = ['sphinxext.opengraph']

ogp_social_cards = {
    "enable": True,
}

Requires Sphinx to be installed and a Sphinx documentation project already configured.

Verify before relying

  • Whether the social-cards extra requires additional system dependencies beyond what pip installs
  • Performance impact when generating metadata for large documentation sites

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — Sphinx
Maintenance aging — 350 days since the last release
Last repo commit
First released
Downloads 743,864/month — #5,175 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sphinxext_opengraph-0.13.0-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: PluginsEnvironment :: Web EnvironmentFramework :: Sphinx :: ExtensionIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Documentation :: SphinxTopic :: Software Development :: DocumentationTopic :: Text ProcessingTopic :: Utilities

Tags

sphinx open graph metadatadocumentation social media previewogp meta tags sphinxsphinx social cardsdocumentation link preview
sphinx-extensionsocial-mediametadata

More Utilities packages