Skip to content

Commit 86770f2

Browse files
hugovkezio-melotti
andauthored
Use sphinxext-opengraph to generate OpenGraph metadata (#953)
Co-authored-by: Ezio Melotti <[email protected]>
1 parent 7dcba58 commit 86770f2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

_static/og-image.png

47.3 KB
Loading

conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'sphinx.ext.intersphinx',
1111
'sphinx.ext.todo',
1212
'sphinx_copybutton',
13+
'sphinxext.opengraph',
1314
'sphinxext.rediraffe',
1415
]
1516

@@ -105,6 +106,16 @@
105106

106107
todo_include_todos = True
107108

109+
# sphinxext-opengraph config
110+
ogp_site_url = "https://devguide.python.org/"
111+
ogp_site_name = "Python Developer's Guide"
112+
ogp_image = "_static/og-image.png"
113+
ogp_custom_meta_tags = [
114+
'<meta property="og:image:width" content="1200">',
115+
'<meta property="og:image:height" content="630">',
116+
'<meta name="theme-color" content="#3776ab" />',
117+
]
118+
108119
# Strip the dollar prompt when copying code
109120
# https://sphinx-copybutton.readthedocs.io/en/latest/use.html#strip-and-configure-input-prompts-for-code-cells
110121
copybutton_prompt_text = "$"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Sphinx==5.3.0
22
furo>=2022.6.4
33
sphinx_copybutton>=0.3.3
44
sphinx-lint==0.6.7
5+
sphinxext-opengraph>=0.7.1
56
sphinxext-rediraffe

0 commit comments

Comments
 (0)