Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Docs version switcher links resolve incorrectly on GitHub Pages

オープン 初心者向け
#73 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
documentation

調査の方向性

scripts/generate_switcher.py の278行目と290行目から始め、続いて docs/source/conf.py:70 と公開済みの switcher.json を確認します。GitHub Pages 上で version-switcher のナビゲーションを再現し、生成されたエントリと json_url がサイトルートを基準とする安定した URL を使用していることを検証します。バージョンを選択すると対応するページまたはそのバージョンのホームページに到達できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
13
フォーク
2
平均マージ
27分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Autodesk/moldflow-api のほかの issue

Autodesk/moldflow-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。