From d47f906925383d9e621662639376fd76d5a98c35 Mon Sep 17 00:00:00 2001 From: Steven Martin Date: Tue, 11 Jun 2024 15:02:57 -0400 Subject: [PATCH] added javascript to handle version links (#470) * added javascript to handle version links * lint fix --------- Co-authored-by: Steven Martin --- layouts/DocsPage/DocsPage.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/DocsPage/DocsPage.tsx b/layouts/DocsPage/DocsPage.tsx index c4e7f2b5d5..3ced583faf 100644 --- a/layouts/DocsPage/DocsPage.tsx +++ b/layouts/DocsPage/DocsPage.tsx @@ -67,6 +67,10 @@ const DocsPage = ({ let path = getPath(latest); + let urlCurrent = "/docs" + path; + // handles the case where it's the home page with / to avoid /docs/docs/ + if (path == "/") urlCurrent = "/"; + return ( <> This chapter covers a past release: {current}. We - recommend the latest{" "} + recommend the latest{" "} version instead. )} {isBetaVersion && ( <> This chapter covers an upcoming release: {current}. We - recommend the latest{" "} + recommend the latest{" "} version instead. )}