File tree 1 file changed +2
-4
lines changed
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def get_tags(
101
101
tags ['og:type' ] = config .ogp_type
102
102
103
103
if not config .ogp_site_url and os .getenv ('READTHEDOCS' ):
104
- ogp_site_url = read_the_docs_site_url ( config . html_baseurl )
104
+ ogp_site_url = ambient_site_url ( )
105
105
else :
106
106
ogp_site_url = config .ogp_site_url
107
107
@@ -236,13 +236,11 @@ def get_tags(
236
236
)
237
237
238
238
239
- def read_the_docs_site_url ( html_baseurl : str | None ) -> str :
239
+ def ambient_site_url ( ) -> str :
240
240
# readthedocs addons sets the READTHEDOCS_CANONICAL_URL variable,
241
241
# or defines the ``html_baseurl`` variable in conf.py
242
242
if rtd_canonical_url := os .getenv ('READTHEDOCS_CANONICAL_URL' ):
243
243
parse_result = urlsplit (rtd_canonical_url )
244
- elif html_baseurl is not None :
245
- parse_result = urlsplit (html_baseurl )
246
244
else :
247
245
msg = 'ReadTheDocs did not provide a valid canonical URL!'
248
246
raise RuntimeError (msg )
You can’t perform that action at this time.
0 commit comments