Skip to content

Commit a58e876

Browse files
committed
Use the create-social-cards tag
1 parent abb4a2c commit a58e876

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
@@ -624,16 +624,19 @@
624624
# Options for sphinxext-opengraph
625625
# -------------------------------
626626

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

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)