Docs version switcher links resolve incorrectly on GitHub Pages
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- python
- Área
- documentation
Línea de trabajo
Comienza en scripts/generate_switcher.py, en las líneas 278 y 290, y revisa después docs/source/conf.py:70 y el switcher.json publicado. Reproduce la navegación del version-switcher en GitHub Pages y verifica que las entradas generadas y json_url usen URLs estables relativas a la raíz del sitio. Se considera terminado cuando seleccionar una versión lleva a la página correspondiente o a la página de inicio de esa versión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 13
- Forks
- 2
- Merge medio
- 49 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Autodesk/moldflow-api
-
Standardize handling of None arguments across API calls using coerce_optional_dispatchPosiblemente ocupada @copilot-swe-agent la tomó hace 311 días. Abierto
Autodesk/moldflow-api#14 · 1 reacción · 1 asignado ·
Todos los issues de Autodesk/moldflow-api
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mohitmishra786/readprism#322 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
API-key credentials accept a blank key: empty via the API, spaces-only via the builder's Add API key dialogPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Significant-Gravitas/AutoGPT#15727 ·
Los mantenedores suelen responder en 1 día