Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Docs version switcher links resolve incorrectly on GitHub Pages

Aperta Adatta ai principianti
#73 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

  1. Open the published docs on GitHub Pages.
  2. Use the version switcher from the UI.
  3. Notice the selected version link does not resolve to the correct docs location.
  4. 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Autodesk/moldflow-api

Tutte le issue di Autodesk/moldflow-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.