From d9e2c8c33fb4ea21750f8f8e2e1cb6a37ba858ae Mon Sep 17 00:00:00 2001 From: Josh Derocher-Vlk Date: Tue, 25 Nov 2025 09:36:51 -0500 Subject: [PATCH 1/2] update links back to current docs --- src/SyntaxLookup.res | 8 +++++++- src/common/Util.res | 5 ++++- src/layouts/SidebarLayout.res | 26 +++++++++----------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/SyntaxLookup.res b/src/SyntaxLookup.res index 22f198e6f..53fe20554 100644 --- a/src/SyntaxLookup.res +++ b/src/SyntaxLookup.res @@ -352,8 +352,14 @@ let default = (props: props) => {
{React.string("Enter some language construct you want to know more about.")}
+

+ {React.string("You are viewing docs for an older version of ReScript.")} +

+ + {React.string("Go to the latest version.")} + -
+
item.name)} diff --git a/src/common/Util.res b/src/common/Util.res index 7ae1a150d..ad5dffa26 100644 --- a/src/common/Util.res +++ b/src/common/Util.res @@ -84,7 +84,10 @@ let removeVersionFromPathname = (pathname: string) => pathname ->Stdlib.String.split("/") ->Array.filter(s => { - let isVersion = s->Stdlib.String.includes("v") && s->Stdlib.String.includes(".") + let isVersion = + (s->Stdlib.String.includes("v") && s->Stdlib.String.includes(".")) || + s == "latest" || + s == "next" !isVersion }) ->Array.join("/") diff --git a/src/layouts/SidebarLayout.res b/src/layouts/SidebarLayout.res index 144d0c635..2ab7e8cf2 100644 --- a/src/layouts/SidebarLayout.res +++ b/src/layouts/SidebarLayout.res @@ -133,8 +133,6 @@ module Sidebar = { None } - let {pathname} = Next.Router.useRouter() - <>

- - {React.string("You are viewing docs for an older version of Rescript.")} -
- {React.string("Go to latest version.")} -
+ {React.string("You are viewing docs for an older version of ReScript.")}

+ Util.removeVersionFromPathname}`} + className="text-11 text-fire underline"> + {React.string("Go to the latest version.")} +
children
From a5fb25be6461636da57c98ff2968efbcfd1ec701 Mon Sep 17 00:00:00 2001 From: Josh Derocher-Vlk Date: Tue, 25 Nov 2025 09:40:58 -0500 Subject: [PATCH 2/2] skipp sync-bundles for older docs --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 053111ff2..bcf2ecd36 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,8 @@ "test": "node scripts/test-examples.mjs && node scripts/test-hrefs.mjs", "reanalyze": "reanalyze -all-cmt .", "update-index": "node scripts/extract-tocs.mjs && node scripts/extract-syntax.mjs", - "deploy": "wrangler deploy" + "deploy": "wrangler deploy", + "sync-bundles": "echo 'Skipping bundle sync for older docs...'" }, "devDependencies": { "@mdx-js/react": "^2.3.0", @@ -80,4 +81,4 @@ "tailwindcss": "^3.3.3", "wrangler": "^4.26.1" } -} +} \ No newline at end of file