From 6e59f0ab47ac1c4e7ba738e0475030edec46c5b6 Mon Sep 17 00:00:00 2001 From: Christian Ehlers Date: Mon, 1 Jun 2026 20:04:34 +0200 Subject: [PATCH 1/2] Update HTML redirects to use absolute URLs and add stable downloads support --- build_versions.sh | 26 ++++++++++++++++++++------ wget-output.txt | 9 --------- 2 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 wget-output.txt diff --git a/build_versions.sh b/build_versions.sh index 4f774cc..ca84848 100644 --- a/build_versions.sh +++ b/build_versions.sh @@ -186,17 +186,18 @@ if [[ "$CURRENT_BRANCH" != "main" ]]; then mkdir -p "$OUTDIR/$PREVIEW_TAG/_static" cp "$SRCDIR/_build/latex/SGWirelessDocs.pdf" "$OUTDIR/$PREVIEW_TAG/_static/SGWirelessDocs.pdf" - # Root redirect → preview + # Root redirect → preview (absolute URL so it can't accumulate when + # Amplify rewrites a 404 to this page while keeping the requested URL). cat > "$OUTDIR/index.html" << EOF - + Redirecting… -

Redirecting to ${PREVIEW_TAG}

+

Redirecting to ${PREVIEW_TAG}

EOF @@ -267,22 +268,35 @@ for TAG in "${TAGS[@]}"; do done # ------------------------------------------------------------------- -# Root redirect → latest version +# Root redirect → latest version (absolute URL so it can't accumulate +# when Amplify rewrites a 404 to this page while keeping the URL). # ------------------------------------------------------------------- cat > "$OUTDIR/index.html" << EOF - + Redirecting… -

Redirecting to ${LATEST}

+

Redirecting to ${LATEST}

EOF +# ------------------------------------------------------------------- +# Stable, version-independent downloads. +# Files placed in _static/downloads are also published at the site root +# under /downloads/ so external sites can link to a permanent URL +# that does not change when the latest version bumps. +# ------------------------------------------------------------------- +if [[ -d "$SRCDIR/_static/downloads" ]]; then + mkdir -p "$OUTDIR/downloads" + cp -r "$SRCDIR/_static/downloads/." "$OUTDIR/downloads/" + echo "Published stable downloads to $OUTDIR/downloads" +fi + echo "" echo "=== Done — output in $OUTDIR ===" echo " Latest: $LATEST" diff --git a/wget-output.txt b/wget-output.txt deleted file mode 100644 index e1c1df1..0000000 --- a/wget-output.txt +++ /dev/null @@ -1,9 +0,0 @@ -Spider mode enabled. Check if remote file exists. ---2026-04-17 15:43:32-- https://mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com/preview/index.html -Resolving mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com (mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com)... 143.204.1.7, 143.204.1.26, 143.204.1.122, ... -Connecting to mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com (mjong2025-patch-1.d16ocb2pu63ur6.amplifyapp.com)|143.204.1.7|:443... connected. -HTTP request sent, awaiting response... 401 Unauthorized - -Username/Password Authentication Failed. -Found no broken links. - From 1c9bd63fc28c49292ef08a3c69506b9a3ff6ae98 Mon Sep 17 00:00:00 2001 From: Christian Ehlers Date: Mon, 1 Jun 2026 20:17:06 +0200 Subject: [PATCH 2/2] Add support for stable downloads in preview builds --- build_versions.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build_versions.sh b/build_versions.sh index ca84848..87ee0a4 100644 --- a/build_versions.sh +++ b/build_versions.sh @@ -202,6 +202,14 @@ if [[ "$CURRENT_BRANCH" != "main" ]]; then EOF + # Stable, version-independent downloads (same as the production build) + # so preview deployments can validate the permanent /downloads/ path. + if [[ -d "$SRCDIR/_static/downloads" ]]; then + mkdir -p "$OUTDIR/downloads" + cp -r "$SRCDIR/_static/downloads/." "$OUTDIR/downloads/" + echo "Published stable downloads to $OUTDIR/downloads" + fi + echo "" echo "=== Done — preview build in $OUTDIR/$PREVIEW_TAG ===" exit 0