Skip to content

Commit 5dbf4bf

Browse files
committed
Docs: fix ogp_custom_meta_tags should be a list.
With tuples I get: ```pytb Traceback (most recent call last): File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinx/events.py", line 404, in emit results.append(listener.handler(self.app, *args)) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinxext/opengraph/__init__.py", line 266, in html_page_context context["metatags"] += get_tags(app, context, doctree, app.config) ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mdk/src/python/python-docs-fr/.venv/lib/python3.13/site-packages/sphinxext/opengraph/__init__.py", line 250, in get_tags [make_tag(p, c) for p, c in tags.items()] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + [make_tag(p, c, "name") for p, c in meta_tags.items()] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + config["ogp_custom_meta_tags"] ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TypeError: can only concatenate list (not "tuple") to list ```
1 parent 0c01090 commit 5dbf4bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,11 @@
576576
'image': '_static/og-image.png',
577577
'line_color': '#3776ab',
578578
}
579-
ogp_custom_meta_tags = ('<meta name="theme-color" content="#3776ab">',)
579+
ogp_custom_meta_tags = ['<meta name="theme-color" content="#3776ab">',]
580580
if 'create-social-cards' not in tags: # noqa: F821
581581
# Define a static preview image when not creating social cards
582582
ogp_image = '_static/og-image.png'
583-
ogp_custom_meta_tags += (
583+
ogp_custom_meta_tags += [
584584
'<meta property="og:image:width" content="200">',
585585
'<meta property="og:image:height" content="200">',
586-
)
586+
]

0 commit comments

Comments
 (0)