deepmodeling / deepmodeling/deepmodeling_sphinx

[Code scan] Preserve user html_baseurl outside Read the Docs

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
2
Forks
6
PR merge metrics
No merged PRs in 30d

Description

This issue is a result of a Codex global code scan of deepmodeling/deepmodeling_sphinx at commit 156679fe55fc61e8ec3b1e9be8a45fde3567b9cb.

Problem

`rtd_config()` is connected for every Sphinx build and assigns `config.html_baseurl` from `READTHEDOCS_CANONICAL_URL` with an empty-string default. Outside Read the Docs, this silently overwrites any `html_baseurl` configured by the project.

Code references:

https://github.com/deepmodeling/deepmodeling_sphinx/blob/156679fe55fc61e8ec3b1e9be8a45fde3567b9cb/deepmodeling_sphinx/inject.py#L180-L191
https://github.com/deepmodeling/deepmodeling_sphinx/blob/156679fe55fc61e8ec3b1e9be8a45fde3567b9cb/deepmodeling_sphinx/inject.py#L221-L222

Impact

Local builds and non-RTD CI builds can lose their configured canonical base URL. This can break canonical links, sitemap generation, and any downstream extension that relies on `html_baseurl`.

Suggested fix

Only assign `html_baseurl` when `READTHEDOCS_CANONICAL_URL` is present, or guard the assignment so it only runs under `READTHEDOCS=True`. Existing project configuration should be preserved otherwise.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.