File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def get_tags(
101101 tags ['og:type' ] = config .ogp_type
102102
103103 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 ( )
105105 else :
106106 ogp_site_url = config .ogp_site_url
107107
@@ -236,13 +236,11 @@ def get_tags(
236236 )
237237
238238
239- def read_the_docs_site_url ( html_baseurl : str | None ) -> str :
239+ def ambient_site_url ( ) -> str :
240240 # readthedocs addons sets the READTHEDOCS_CANONICAL_URL variable,
241241 # or defines the ``html_baseurl`` variable in conf.py
242242 if rtd_canonical_url := os .getenv ('READTHEDOCS_CANONICAL_URL' ):
243243 parse_result = urlsplit (rtd_canonical_url )
244- elif html_baseurl is not None :
245- parse_result = urlsplit (html_baseurl )
246244 else :
247245 msg = 'ReadTheDocs did not provide a valid canonical URL!'
248246 raise RuntimeError (msg )
You can’t perform that action at this time.
0 commit comments