Skip to content

Commit fbc5651

Browse files
committed
Use the create-social-cards tag
1 parent 271cfba commit fbc5651

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

Doc/conf.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -621,16 +621,19 @@
621621
# Options for sphinxext-opengraph
622622
# -------------------------------
623623

624-
ogp_site_url = 'https://hugovk-cpython.readthedocs.io/en/ogp_social_cards/'
624+
ogp_site_url = 'https://docs.python.org/3/'
625625
ogp_site_name = 'Python documentation'
626-
# ogp_image = '_static/og-image.png'
627-
# ogp_custom_meta_tags = [
628-
# '<meta property="og:image:width" content="200" />',
629-
# '<meta property="og:image:height" content="200" />',
630-
# '<meta name="theme-color" content="#3776ab" />',
631-
# ]
632-
633-
ogp_social_cards = {
634-
"image": "_static/og-image.png",
635-
"line_color": "#3776ab",
626+
ogp_social_cards = { # Used when matplotlib is installed
627+
'image': '_static/og-image.png',
628+
'line_color': '#3776ab',
636629
}
630+
ogp_custom_meta_tags = [
631+
'<meta name="theme-color" content="#3776ab" />',
632+
]
633+
if 'create-social-cards' not in tags: # noqa: F821
634+
# Define a static preview image when not creating social cards
635+
ogp_image = '_static/og-image.png'
636+
ogp_custom_meta_tags += [
637+
'<meta property="og:image:width" content="200" />',
638+
'<meta property="og:image:height" content="200" />',
639+
]

Doc/requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ sphinx-notfound-page~=1.0.0
1919
python-docs-theme>=2023.3.1,!=2023.7
2020

2121
-c constraints.txt
22-
23-
matplotlib

0 commit comments

Comments
 (0)