Skip to content

Commit ebda3a4

Browse files
m-aciekblurb-it[bot]
authored andcommitted
pythongh-136155: Docs: only add custom OpenGraph protocol meta tags for HTML builds (python#136187)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent d49109d commit ebda3a4

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Doc/conf.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -635,13 +635,14 @@
635635
'image': '_static/og-image.png',
636636
'line_color': '#3776ab',
637637
}
638-
ogp_custom_meta_tags = [
639-
'<meta name="theme-color" content="#3776ab">',
640-
]
641-
if 'create-social-cards' not in tags: # noqa: F821
642-
# Define a static preview image when not creating social cards
643-
ogp_image = '_static/og-image.png'
644-
ogp_custom_meta_tags += [
645-
'<meta property="og:image:width" content="200">',
646-
'<meta property="og:image:height" content="200">',
638+
if 'builder_html' in tags: # noqa: F821
639+
ogp_custom_meta_tags = [
640+
'<meta name="theme-color" content="#3776ab">',
647641
]
642+
if 'create-social-cards' not in tags: # noqa: F821
643+
# Define a static preview image when not creating social cards
644+
ogp_image = '_static/og-image.png'
645+
ogp_custom_meta_tags += [
646+
'<meta property="og:image:width" content="200">',
647+
'<meta property="og:image:height" content="200">',
648+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EPUB builds are fixed by excluding non-XHTML-compatible tags.

0 commit comments

Comments
 (0)