Skip to content

Commit e655064

Browse files
committed
fix(config[source_branch]): Change source_branch default from "master" to "main"
why: Repo default branch is main; "master" default caused broken "Edit on GitHub" and "View source" links on every docs page. what: - Change source_branch parameter default in merge_sphinx_config() to "main" - Change DEFAULT_THEME_OPTIONS["source_branch"] seed value to "main" - Update docs/conf.py source_branch kwarg to "main" - Update configuration.md table rows to reflect new defaults
1 parent caa7d72 commit e655064

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
copyright=gp_sphinx.__copyright__,
3434
source_repository=f"{gp_sphinx.__github__}/",
3535
docs_url=gp_sphinx.__docs__,
36-
source_branch="master",
36+
source_branch="main",
3737
extra_extensions=[
3838
"package_reference",
3939
"sphinx_autodoc_pytest_fixtures",

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ All parameters are keyword-only.
3838
| `remove_extensions` | `list[str] \| None` | `None` | Extensions removed from the selected base list |
3939
| `theme_options` | `dict[str, Any] \| None` | `None` | Deep-merged into `DEFAULT_THEME_OPTIONS` after auto-populated source/logo values |
4040
| `source_repository` | `str \| None` | `None` | GitHub repository URL used for issue links, footer icon URLs, and theme source metadata |
41-
| `source_branch` | `str` | `"master"` | Source branch stored in `html_theme_options["source_branch"]` |
41+
| `source_branch` | `str` | `"main"` | Source branch stored in `html_theme_options["source_branch"]` |
4242
| `light_logo` | `str \| None` | `None` | Light-mode logo path merged into theme options |
4343
| `dark_logo` | `str \| None` | `None` | Dark-mode logo path merged into theme options |
4444
| `docs_url` | `str \| None` | `None` | Canonical docs URL used to derive Open Graph settings |
@@ -112,7 +112,7 @@ These are injected even though they are not exposed as `DEFAULT_*` constants:
112112
| Constant | Value |
113113
| --- | --- |
114114
| `DEFAULT_THEME` | `"sphinx-gptheme"` |
115-
| `DEFAULT_THEME_OPTIONS` | footer GitHub icon, `source_repository=""`, `source_branch="master"`, `source_directory="docs/"` |
115+
| `DEFAULT_THEME_OPTIONS` | footer GitHub icon, `source_repository=""`, `source_branch="main"`, `source_directory="docs/"` |
116116

117117
### Font defaults
118118

packages/gp-sphinx/src/gp_sphinx/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def merge_sphinx_config(
214214
remove_extensions: list[str] | None = None,
215215
theme_options: dict[str, t.Any] | None = None,
216216
source_repository: str | None = None,
217-
source_branch: str = "master",
217+
source_branch: str = "main",
218218
light_logo: str | None = None,
219219
dark_logo: str | None = None,
220220
docs_url: str | None = None,

packages/gp-sphinx/src/gp_sphinx/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class FontConfig(_FontConfigRequired, total=False):
115115
},
116116
],
117117
"source_repository": "",
118-
"source_branch": "master",
118+
"source_branch": "main",
119119
"source_directory": "docs/",
120120
}
121121
"""Default Furo theme options.

0 commit comments

Comments
 (0)