Skip to content

Commit 7393d70

Browse files
committed
feat(theme)!: rename version_slug to version_id
1 parent 79ade20 commit 7393d70

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

docs/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100

101101
# -- Options for theme development -------------------------------------------
102102

103-
version_slug = os.environ.get("READTHEDOCS_VERSION", "latest")
103+
version_id = os.environ.get("READTHEDOCS_VERSION", "latest")
104104

105105
templates_path = ["_templates"]
106106

@@ -112,11 +112,11 @@
112112
"github_repo": "breeze",
113113
"github_version": "main",
114114
"doc_path": "docs",
115-
"version_slug": version_slug,
115+
"version_id": version_id,
116116
"version_switcher_url": "https://raw.githubusercontent.com/aksiome/breeze/refs/heads/main/docs/_static/switcher.json",
117117
"languages": [
118-
("English", f"/en/{version_slug}/%s/", "en"),
119-
("Français", f"/fr/{version_slug}/%s/", "fr"),
120-
("中文", f"/zh/{version_slug}/%s/", "zh"),
118+
("English", f"/en/{version_id}/%s/", "en"),
119+
("Français", f"/fr/{version_id}/%s/", "fr"),
120+
("中文", f"/zh/{version_id}/%s/", "zh"),
121121
],
122122
}

docs/user_guide/components/lang-switcher.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ For Read the Docs hosted documentation, use environment variables for dynamic ve
3838
```python
3939
import os
4040

41-
version_slug = os.environ.get("READTHEDOCS_VERSION", "latest")
41+
version_id = os.environ.get("READTHEDOCS_VERSION", "latest")
4242

4343
html_context = {
4444
"languages": [
45-
("English", f"/en/{version_slug}/%s/", "en"),
46-
("Français", f"/fr/{version_slug}/%s/", "fr"),
45+
("English", f"/en/{version_id}/%s/", "en"),
46+
("Français", f"/fr/{version_id}/%s/", "fr"),
4747
],
4848
}
4949
```

docs/user_guide/components/version-switcher.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Configure the version switcher via `html_context` in `conf.py`:
88

99
```python
1010
html_context = {
11-
"version_slug": "v2.0",
11+
"version_id": "v2.0",
1212
"version_switcher_url": "https://example.com/docs/_static/switcher.json",
1313
}
1414
```
1515

1616
| Key | Description |
1717
|-----|-------------|
18-
| `version_slug` | The currently displayed version |
18+
| `version_id` | The currently displayed version |
1919
| `version_switcher_url` | URL to the JSON file containing version data |
2020

2121
## Version JSON format
@@ -48,7 +48,7 @@ Each version object accepts:
4848
| Key | Description |
4949
|-----|-------------|
5050
| `name` | Display name in dropdown |
51-
| `version` | Version identifier (matches `version_slug`) |
51+
| `version` | Version identifier (matches `version_id`) |
5252
| `url` | Base URL for this version |
5353
| `preferred` | Optional. Mark as the recommended version |
5454

@@ -59,10 +59,10 @@ For Read the Docs, use environment variables:
5959
```python
6060
import os
6161

62-
version_slug = os.environ.get("READTHEDOCS_VERSION", "latest")
62+
version_id = os.environ.get("READTHEDOCS_VERSION", "latest")
6363

6464
html_context = {
65-
"version_slug": version_slug,
65+
"version_id": version_id,
6666
"version_switcher_url": "https://raw.githubusercontent.com/org/repo/main/docs/_static/switcher.json",
6767
}
6868
```

src/sphinx_breeze_theme/theme/breeze/components/version-switcher.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
{%- if version_slug and version_switcher_url -%}
1+
{%- if version_id and version_switcher_url -%}
22
<div class="bz-version-switcher bz-dropdown">
33
<button
44
aria-label="{{ _('Change version') }}"
55
aria-haspopup="true"
66
aria-expanded="false"
77
data-url="{{ version_switcher_url }}"
8-
data-current="{{ version_slug }}"
8+
data-current="{{ version_id }}"
99
>
1010
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
1111
<path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path>
1212
</svg>
13-
<span>{{ version_slug }}</span>
13+
<span>{{ version_id }}</span>
1414
</button>
1515
<ul role="menu" aria-hidden="true"></ul>
1616
</div>

0 commit comments

Comments
 (0)