Docs version switcher links resolve incorrectly on GitHub Pages
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- documentation
Direzione di ricerca
Inizia in scripts/generate_switcher.py alle righe 278 e 290, quindi esamina docs/source/conf.py:70 e lo switcher.json pubblicato. Riproduci la navigazione del version-switcher su GitHub Pages e verifica che le voci generate e json_url utilizzino URL stabili relativi alla radice del sito. Il lavoro è completato quando la selezione di una versione porta alla pagina corrispondente o alla homepage di quella versione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The docs version switcher on GitHub Pages is generating/using the wrong links.
Direct version URLs work, for example:
https://autodesk.github.io/moldflow-api/v26.0.5/https://autodesk.github.io/moldflow-api/latest/
But using the version switcher UI takes you to the wrong location instead of the corresponding page in the selected version.
Current behavior
The published switcher data at:
https://autodesk.github.io/moldflow-api/latest/_static/switcher.json
currently contains entries like:
{
"version": "v26.0.5",
"url": "../v26.0.5/"
}
Those relative URLs appear to be the root cause of the bad navigation in the switcher UI on GitHub Pages.
Expected behavior
Selecting a version from the switcher should take the user to the same doc page in the selected version when it exists, or fall back to that version's homepage.
For GitHub Pages, the switcher entries should point at the correct version root for the site, e.g.:
https://autodesk.github.io/moldflow-api/v26.0.5/https://autodesk.github.io/moldflow-api/v27.0.0/
rather than relative paths like ../v26.0.5/.
Local code context
The current local checkout shows the switcher URLs are generated here:
scripts/generate_switcher.py
Specifically:
scripts/generate_switcher.py:278->"url": f"../{json_version}/"scripts/generate_switcher.py:290->"url": f"../{tag}/"
There is also related switcher config here:
docs/source/conf.py:70->"json_url": "_static/switcher.json"
PyData Sphinx Theme's docs say switcher['json_url'] should be a stable, fully resolved URL, so that may also be worth reviewing as part of the fix.
Repro
- Open the published docs on GitHub Pages.
- Use the version switcher from the UI.
- Notice the selected version link does not resolve to the correct docs location.
- Compare that with opening the direct version URL manually, which works.
Likely fix
Generate version switcher entries using the GitHub Pages site root (or another stable absolute docs base URL) instead of relative ../<version>/ paths, and verify json_url is also configured as a stable absolute URL.
- Lingua principale
- Python
- Stelle
- 13
- Fork
- 2
- Merge medio
- 27m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Autodesk/moldflow-api
-
Standardize handling of None arguments across API calls using coerce_optional_dispatchForse già presa @copilot-swe-agent l’ha presa 300 giorni fa. Aperta
Autodesk/moldflow-api#14 · 1 reazione · 1 assegnatario ·
Tutte le issue di Autodesk/moldflow-api
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
SR_SECURITY_DESCRIPTOR.fromString drops the SACL when no DACL is presentForse già presa @paul7436 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
equinor/fmu-sumo-uploader#302 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelscope/evalscope#1821 ·
I maintainer di solito rispondono entro 1 giorno
-
Sanity on ansible-core devel fails: ignore-2.23.txt references the removed import-3.9 testForse già presa @yurnov l’ha presa oggi. Apertaneeds_triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
ansible-collections/kubernetes.core#1275 ·
I maintainer di solito rispondono entro 1 giorno