]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-136155: Docs: only add custom OpenGraph protocol meta tags for HTML builds (#136187)
authorMaciej Olko <maciej.olko@affirm.com>
Mon, 7 Jul 2025 13:29:27 +0000 (15:29 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Jul 2025 13:29:27 +0000 (16:29 +0300)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Doc/conf.py
Misc/NEWS.d/next/Documentation/2025-07-01-21-04-47.gh-issue-136155.ufmH4Q.rst [new file with mode: 0644]

index 161c2986441eddda35fa110cb7012afd79285c8d..8b2a8f20fcc5583254790420e2c4d18801ff9f57 100644 (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">',
+        ]
diff --git a/Misc/NEWS.d/next/Documentation/2025-07-01-21-04-47.gh-issue-136155.ufmH4Q.rst b/Misc/NEWS.d/next/Documentation/2025-07-01-21-04-47.gh-issue-136155.ufmH4Q.rst
new file mode 100644 (file)
index 0000000..0341b5f
--- /dev/null
@@ -0,0 +1 @@
+EPUB builds are fixed by excluding non-XHTML-compatible tags.