Add meta tags using an Open Graph extension
This commit is contained in:
+14
-1
@@ -30,7 +30,8 @@ import os
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx_tabs.tabs',
|
||||
'sphinx_copybutton'
|
||||
'sphinx_copybutton',
|
||||
'sphinxext.opengraph',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@@ -298,3 +299,15 @@ user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25
|
||||
|
||||
# sphinx-tabs configuration
|
||||
sphinx_tabs_disable_tab_closing = True
|
||||
|
||||
# sphinxext-opengraph configuration
|
||||
|
||||
ogp_image = '_images/logo.png'
|
||||
ogp_use_first_image = True
|
||||
ogp_enable_meta_description = True
|
||||
ogp_description_length = 300
|
||||
|
||||
## RTD sets html_baseurl, ensures we use the correct env for canonical URLs
|
||||
## Useful to generate correct meta tags for Open Graph
|
||||
## Refs: https://github.com/readthedocs/readthedocs.org/issues/10226, https://github.com/urllib3/urllib3/pull/3064
|
||||
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "/")
|
||||
|
||||
Reference in New Issue
Block a user