Skip to content

Commit 71c84fa

Browse files
hugovkAA-Turner
andauthored
[3.12] GH-136155: Use sphinxext-opengraph v0.12.0 (GH-137393) (#138741)
(cherry picked from commit 39bd7c3) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 1793b72 commit 71c84fa

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Doc/conf.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,17 @@
598598
# Options for sphinxext-opengraph
599599
# -------------------------------
600600

601-
ogp_site_url = 'https://docs.python.org/3/'
601+
ogp_canonical_url = 'https://docs.python.org/3/'
602602
ogp_site_name = 'Python documentation'
603-
ogp_image = '_static/og-image.png'
604-
ogp_custom_meta_tags = (
605-
'<meta property="og:image:width" content="200">',
606-
'<meta property="og:image:height" content="200">',
607-
'<meta name="theme-color" content="#3776ab">',
608-
)
603+
ogp_social_cards = { # Used when matplotlib is installed
604+
'image': '_static/og-image.png',
605+
'line_color': '#3776ab',
606+
}
607+
ogp_custom_meta_tags = ('<meta name="theme-color" content="#3776ab">',)
608+
if 'create-social-cards' not in tags: # noqa: F821
609+
# Define a static preview image when not creating social cards
610+
ogp_image = '_static/og-image.png'
611+
ogp_custom_meta_tags += (
612+
'<meta property="og:image:width" content="200">',
613+
'<meta property="og:image:height" content="200">',
614+
)

0 commit comments

Comments
 (0)