Skip to content

Commit 5a5fe19

Browse files
koriymclaude
andcommitted
Fix Learn site snapshot: use wget --trust-server-names for /ja/ index.html layout
The Build Learn site step failed its `test -f snapshot/ja/index.html` assertions. The Learn app renders bare links (href="/ja") while vinext runs with trailingSlash:true, so each bare link 308-redirects to "/ja/". wget named files after the pre-redirect URL (ja / ja.html with -E), never producing the directory index.html layout GitHub Pages needs. --trust-server-names makes wget name files after the redirect target, so "/ja/" -> ja/index.html and "/ja/rest/" -> ja/rest/index.html. Drops -E and needs no post-download restructuring. Verified locally: all test -f assertions pass and converted links resolve under /learn/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2c88e5e commit 5a5fe19

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/pages.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,17 @@ jobs:
9292
done
9393
# Crawl to static HTML. wget exits 8 if any optional asset 404s; that is
9494
# not fatal for a static snapshot, and steps run under `set -e`.
95+
#
96+
# The Learn app renders bare links (href="/ja", href="/ja/rest") while the
97+
# vinext server runs with trailingSlash:true, so each bare link 308-redirects
98+
# to its "/.../" form. By default wget names the local file after the ORIGINAL
99+
# (pre-redirect) URL -> "ja"/"ja.html", which never produces the directory
100+
# "index.html" layout GitHub Pages needs. --trust-server-names makes wget name
101+
# the file after the redirect TARGET ("/ja/" -> ja/index.html, "/ja/rest/" ->
102+
# ja/rest/index.html), giving the natural directory structure with no -E and no
103+
# post-download restructuring.
95104
mkdir -p snapshot
96-
( cd snapshot && wget -nv -r -l 3 -p -k -E -nH -e robots=off http://localhost:4399/ ) || true
105+
( cd snapshot && wget -nv -r -l 3 -p -k -nH --trust-server-names -e robots=off http://localhost:4399/ ) || true
97106
kill "$server_pid" 2>/dev/null || true
98107
# wget -p does not fetch assets referenced only from inline-style url()
99108
# (e.g. /bear-logo.png), so copy the public assets in explicitly...

0 commit comments

Comments
 (0)