Docs version switcher links resolve incorrectly on GitHub Pages
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
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
- 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.
- 主要言語
- Python
- スター
- 13
- フォーク
- 2
- 平均マージ
- 27分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Autodesk/moldflow-api のほかの issue
-
Standardize handling of None arguments across API calls using coerce_optional_dispatch対応中かも @copilot-swe-agent が 299 日前に担当しました。 オープン
Autodesk/moldflow-api#14 · リアクション 1 件 · 担当者 1 名 ·
Autodesk/moldflow-api の issue をすべて見る
似ている issue
-
area/install reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
FluidNumerics/fluid-walk-blocker#191 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
TransformerLensOrg/TransformerLens#1868 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
climate-analytics-lab/jax-gcm#1057 ·
メンテナーはふだん 1 日以内に返信