Social Cards

This extension enables the generation and embedding of social media cards (AKA “social media previews”).

_images/index-476430c6f45f9ddf.png

Note

This extension is heavily influenced by the mkdocs-material theme’s builtin social plugin. Beware that this does not imply interoperability. Some features supported in this extension are not supported in the mkdocs-material implementation and vice versa.

Dependencies

The following dependencies are used:

pydantic>=2.4
pydantic-extra-types
PySide6
pyyaml
requests
sphinx
typing_extensions

Installing

Install using pip
pip install sphinx-social-cards

Installing from the source hosted at https://github.com/2bndy5/sphinx-social-cards will require Node.js (and npm) available to optimize and bundle SVG icons from npm packages. See image_paths for a list of bundled icons.

Usage

The Configuration describes how to use this extension in your documentation’s conf.py. Additionally, the social cards generated can be tailored with Customized Layouts. There are also Directives provided for finite control over the generated image for a specific page. Lastly, sphinx-social-cards Plugins can be used to easily share customizations between documentation projects.