From a6c32df1ff509bbea097f957bd653a98bb0cba01 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 23 Nov 2024 17:27:39 -0500 Subject: [PATCH] feat: language version selector --- src/layouts/NewDocsLayout.astro | 64 ++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/src/layouts/NewDocsLayout.astro b/src/layouts/NewDocsLayout.astro index adbed62..f2067c7 100644 --- a/src/layouts/NewDocsLayout.astro +++ b/src/layouts/NewDocsLayout.astro @@ -110,7 +110,10 @@ function sort_posts(p1, p2) { } } -const versions = ["latest", "v0.0.1"]; +const versions = ["latest", "v0.0.1"].filter((x) => x !== version); +const url_components = base_url.split(version); +const lc = url_components[0] ?? ""; +const rc = url_components[1] ?? ""; --- @@ -125,22 +128,51 @@ const versions = ["latest", "v0.0.1"]; border-c-border-1 -translate-x-64 lg:translate-x-0 transition-transform" >