From 2ba5a9c21f5fab0c9dd3d854893ce0b3c3c3bac4 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 23 Mar 2026 21:39:28 +0000 Subject: [PATCH 1/2] Redirect to postgraphile.org --- gatsby-browser.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 gatsby-browser.js diff --git a/gatsby-browser.js b/gatsby-browser.js new file mode 100644 index 000000000..c78a3e26d --- /dev/null +++ b/gatsby-browser.js @@ -0,0 +1,17 @@ +function checkRedirect(inPath) { + const path = inPath.replace(/\/+$/, ""); + if (path === "/postgraphile" || path.startsWith("/postgraphile/")) { + const parts = path.split("/"); + if (!parts[2]) { + window.location.replace(`https://postgraphile.org`); + } else { + if (parts[2] === "introduction") parts.length = 2; + parts.splice(2, 0, "4"); + window.location.replace(`https://postgraphile.org${parts.join("/")}`); + } + } +} + +exports.onRouteUpdate = ({ location, prevLocation }) => { + checkRedirect(location.pathname); +}; From 98509d6d5a7b49500d59e579d6eb76c7824db3db Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 23 Mar 2026 21:42:28 +0000 Subject: [PATCH 2/2] And for build website --- gatsby-browser.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gatsby-browser.js b/gatsby-browser.js index c78a3e26d..d0e12dcf4 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -10,6 +10,16 @@ function checkRedirect(inPath) { window.location.replace(`https://postgraphile.org${parts.join("/")}`); } } + if (path === "/graphile-build" || path.startsWith("/graphile-build/")) { + const parts = path.split("/"); + if (!parts[2]) { + window.location.replace(`https://build.graphile.org`); + } else { + if (parts[2] === "introduction") parts.length = 2; + parts.splice(2, 0, "4"); + window.location.replace(`https://build.graphile.org${parts.join("/")}`); + } + } } exports.onRouteUpdate = ({ location, prevLocation }) => {