sphinxext-opengraph
Sphinx Extension to enable OGP support
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-opengraphuv
uv add sphinxext-opengraphpoetry
poetry add sphinxext-opengraphInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
linkpreviewExtracts preview metadata (title, description,…
permissive · top 15,000 on PyPI
sphinx-reredirectsSphinx extension that generates HTML redirect…
unclear · top 5,000 on PyPI
sphinx-automodapiSphinx extension that automatically generates…
permissive · top 15,000 on PyPI
sphinx-faviconA Sphinx extension that injects custom favicon…
permissive · top 15,000 on PyPI
sphinx-hoverxrefSphinx extension that displays tooltips with…
permissive · top 15,000 on PyPI
sphinxext-rediraffeA Sphinx extension that automatically redirects…
permissive · top 15,000 on PyPI
sphinxcontrib-imagesA Sphinx extension that replaces standard image…
permissive · top 15,000 on PyPI
sphinx_designA Sphinx extension that adds responsive web…
permissive · top 5,000 on PyPI
neoteroi-mkdocsProvides a collection of MkDocs plugins and…
permissive · top 15,000 on PyPI
extructExtracts structured metadata from HTML markup…
permissive · top 15,000 on PyPI