| 1 |
# Configuration file for the Sphinx documentation builder. |
| 2 |
# |
| 3 |
# This file only contains a selection of the most common options. For a full |
| 4 |
# list see the documentation: |
| 5 |
# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 |
|
| 7 |
from __future__ import annotations |
| 8 |
|
| 9 |
import sys |
| 10 |
from pathlib import Path |
| 11 |
from subprocess import run |
| 12 |
|
| 13 |
import sphinxext.opengraph |
| 14 |
|
| 15 |
# -- Path setup -------------------------------------------------------------- |
| 16 |
|
| 17 |
sys.path.insert(0, str(Path(__file__).parent.parent)) |
| 18 |
|
| 19 |
# -- Project information ----------------------------------------------------- |
| 20 |
|
| 21 |
project = 'sphinxext-opengraph' |
| 22 |
copyright = ( |
| 23 |
'2020, FIRST', |
| 24 |
'2025-%Y, the Sphinx developers', |
| 25 |
) |
| 26 |
|
| 27 |
version = sphinxext.opengraph.__version__ |
| 28 |
|
| 29 |
|
| 30 |
# -- General configuration --------------------------------------------------- |
| 31 |
|
| 32 |
# Add any Sphinx extension module names here, as strings. They can be |
| 33 |
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 34 |
# ones. |
| 35 |
extensions = [ |
| 36 |
'sphinx.ext.intersphinx', |
| 37 |
'sphinx_design', |
| 38 |
'sphinxext.opengraph', |
| 39 |
] |
| 40 |
|
| 41 |
# Add any paths that contain templates here, relative to this directory. |
| 42 |
templates_path = ['_templates'] |
| 43 |
|
| 44 |
# List of patterns, relative to source directory, that match files and |
| 45 |
# directories to ignore when looking for source files. |
| 46 |
# This pattern also affects html_static_path and html_extra_path. |
| 47 |
exclude_patterns = [] |
| 48 |
|
| 49 |
# -- Options for HTML output ------------------------------------------------- |
| 50 |
|
| 51 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 52 |
# a list of builtin themes. |
| 53 |
# |
| 54 |
html_title = 'sphinxext-opengraph' |
| 55 |
html_logo = '_static/og-logo.png' |
| 56 |
html_theme = 'furo' |
| 57 |
|
| 58 |
|
| 59 |
intersphinx_mapping = { |
| 60 |
'sphinx': ('https://www.sphinx-doc.org/', None), |
| 61 |
} |
| 62 |
|
| 63 |
# -- Configuration for this theme -------------------------------------------- |
| 64 |
|
| 65 |
ogp_site_url = 'https://sphinxext-opengraph.readthedocs.io/en/latest/' |
| 66 |
|
| 67 |
# Configuration for testing but generally we use the defaults |
| 68 |
# Uncomment lines to see their effect. |
| 69 |
ogp_social_cards = { |
| 70 |
'site_url': 'sphinxext-opengraph.readthedocs.io', |
| 71 |
# "image": "TODO: add another image to test", |
| 72 |
# "line_color": "#4078c0", |
| 73 |
} |
| 74 |
|
| 75 |
# Generate sample social media preview images |
| 76 |
path_script = Path( |
| 77 |
__file__, '..', 'script', 'generate_social_card_previews.py' |
| 78 |
).resolve() |
| 79 |
run((sys.executable, path_script), check=False) # NoQA: S603 |