gh-136155: Docs: only add custom OpenGraph protocol meta tags for HTML builds (#136187)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
Maciej Olko
2025-07-07 15:29:27 +02:00
committed by GitHub
parent b7aa2a4b4d
commit c45da6ae16
2 changed files with 11 additions and 9 deletions
+10 -9
View File
@@ -635,13 +635,14 @@ ogp_social_cards = { # Used when matplotlib is installed
'image': '_static/og-image.png',
'line_color': '#3776ab',
}
ogp_custom_meta_tags = [
'<meta name="theme-color" content="#3776ab">',
]
if 'create-social-cards' not in tags: # noqa: F821
# Define a static preview image when not creating social cards
ogp_image = '_static/og-image.png'
ogp_custom_meta_tags += [
'<meta property="og:image:width" content="200">',
'<meta property="og:image:height" content="200">',
if 'builder_html' in tags: # noqa: F821
ogp_custom_meta_tags = [
'<meta name="theme-color" content="#3776ab">',
]
if 'create-social-cards' not in tags: # noqa: F821
# Define a static preview image when not creating social cards
ogp_image = '_static/og-image.png'
ogp_custom_meta_tags += [
'<meta property="og:image:width" content="200">',
'<meta property="og:image:height" content="200">',
]
@@ -0,0 +1 @@
EPUB builds are fixed by excluding non-XHTML-compatible tags.