mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
Use sphinxext-opengraph to generate OpenGraph metadata (GH-99931)
(cherry picked from commit f49c735e52
)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
This commit is contained in:
parent
f43b3d51a9
commit
0274a3bc3b
4 changed files with 33 additions and 4 deletions
34
Doc/conf.py
34
Doc/conf.py
|
@ -13,9 +13,25 @@ sys.path.append(os.path.abspath('includes'))
|
|||
# General configuration
|
||||
# ---------------------
|
||||
|
||||
extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest',
|
||||
'pyspecific', 'c_annotations', 'escape4chm',
|
||||
'asdl_highlight', 'peg_highlight', 'glossary_search']
|
||||
extensions = [
|
||||
'asdl_highlight',
|
||||
'c_annotations',
|
||||
'escape4chm',
|
||||
'glossary_search',
|
||||
'peg_highlight',
|
||||
'pyspecific',
|
||||
'sphinx.ext.coverage',
|
||||
'sphinx.ext.doctest',
|
||||
]
|
||||
|
||||
# Skip if downstream redistributors haven't installed it
|
||||
try:
|
||||
import sphinxext.opengraph
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
extensions.append('sphinxext.opengraph')
|
||||
|
||||
|
||||
doctest_global_setup = '''
|
||||
try:
|
||||
|
@ -109,7 +125,7 @@ html_additional_pages = {
|
|||
html_use_opensearch = 'https://docs.python.org/' + version
|
||||
|
||||
# Additional static files.
|
||||
html_static_path = ['tools/static']
|
||||
html_static_path = ['_static', 'tools/static']
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'python' + release.replace('.', '')
|
||||
|
@ -234,3 +250,13 @@ linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+']
|
|||
# Relative filename of the data files
|
||||
refcount_file = 'data/refcounts.dat'
|
||||
stable_abi_file = 'data/stable_abi.dat'
|
||||
|
||||
# sphinxext-opengraph config
|
||||
ogp_site_url = 'https://docs.python.org/3/'
|
||||
ogp_site_name = 'Python documentation'
|
||||
ogp_image = '_static/og-image.png'
|
||||
ogp_custom_meta_tags = [
|
||||
'<meta property="og:image:width" content="200">',
|
||||
'<meta property="og:image:height" content="200">',
|
||||
'<meta name="theme-color" content="#3776ab">',
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue