Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sphinxext/opengraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ def get_tags(


def ambient_site_url() -> str:
# readthedocs addons sets the READTHEDOCS_CANONICAL_URL variable,
# or defines the ``html_baseurl`` variable in conf.py
# readthedocs addons sets the READTHEDOCS_CANONICAL_URL variable
if rtd_canonical_url := os.getenv('READTHEDOCS_CANONICAL_URL'):
parse_result = urlsplit(rtd_canonical_url)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def test_rtd_override(app: Sphinx, monkeypatch):
@pytest.mark.sphinx('html', testroot='rtd-default')
def test_rtd_valid(app: Sphinx, monkeypatch):
monkeypatch.setenv('READTHEDOCS', 'True')
app.config.html_baseurl = 'https://failure.com/en/latest/'
monkeypatch.setenv('READTHEDOCS_CANONICAL_URL', 'https://failure.com/en/latest/')

app.build()
tags = conftest._og_meta_tags(app)
Expand Down
Loading