docs: add opengraph sphinx extension

This extension helps add metadata etc to the rendered HTML documentation
to help for example links on discourse.jupyter.org look good.
This commit is contained in:
Erik Sundell
2022-11-22 17:16:08 +01:00
parent 96d4486ae5
commit d23e095106
2 changed files with 8 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ extensions = [
"autodoc_traits",
"sphinx_copybutton",
"sphinx-jsonschema",
"sphinxext.opengraph",
"myst_parser",
]
root_doc = "index"
@@ -192,3 +193,9 @@ intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"tornado": ("https://www.tornadoweb.org/en/stable/", None),
}
# -- Options for the opengraph extension -------------------------------------
# ref: https://github.com/wpilibsuite/sphinxext-opengraph#options
#
# ogp_site_url is set automatically by RTD
ogp_image = "_static/logo.png"
ogp_use_first_image = True