Skip to content

Commit 2a88207

Browse files
committed
Check RTD environment
1 parent edc4662 commit 2a88207

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sphinxext/opengraph/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ def get_tags(
6767
# type tag
6868
tags["og:type"] = config["ogp_type"]
6969

70+
from sphinx.util import logging
71+
72+
log = logging.getLogger(__name__)
73+
7074
if os.getenv("READTHEDOCS") and config["ogp_site_url"] is None:
7175
# readthedocs uses html_baseurl for sphinx > 1.8
7276
parse_result = urlparse(config["html_baseurl"])
73-
77+
log.info(config["html_baseurl"])
78+
log.info(config["ogp_site_url"])
7479
if config["html_baseurl"] is None:
7580
raise EnvironmentError("ReadTheDocs did not provide a valid canonical URL!")
7681

@@ -86,6 +91,8 @@ def get_tags(
8691
)
8792
)
8893

94+
log.info(config["ogp_site_url"])
95+
8996
# url tag
9097
# Get the URL of the specific page
9198
if context["builder"] == "dirhtml":

0 commit comments

Comments
 (0)