diff --git a/.github/workflows/404.html b/.github/workflows/404.html index 116ddbb7f8ad827..4c3a717c8aa2b0d 100644 --- a/.github/workflows/404.html +++ b/.github/workflows/404.html @@ -2,16 +2,9 @@ 404 Page Not Found +

404 Page Not Found

- diff --git a/.github/workflows/404.js b/.github/workflows/404.js new file mode 100644 index 000000000000000..b973f7202270e41 --- /dev/null +++ b/.github/workflows/404.js @@ -0,0 +1,8 @@ +window.addEventListener("DOMContentLoaded", () => { + if (document.location.hostname.endsWith("content.dev.mdn.mozit.cloud")) { + const link = document.createElement("a"); + link.href = `https://developer.mozilla.org${location.pathname}`; + link.textContent = "View on MDN production server"; + document.body.appendChild(link); + } +}); diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index cf61e3a63ebcada..e592b120cac026f 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -108,6 +108,7 @@ jobs: # Add the custom 404 page to provide production links to the unbuilt documents mkdir -p ${BUILD_OUT_ROOT}/en-us/_spas/ cp -v ./.github/workflows/404.html ${BUILD_OUT_ROOT}/en-us/_spas/404.html + cp -v ./.github/workflows/404.js ${BUILD_OUT_ROOT}/en-us/_spas/404.js # Download the raw diff blob and store that inside the build # directory.