feat: begin to version docs

This commit is contained in:
Araozu 2024-11-23 18:35:32 -05:00
parent a6c32df1ff
commit 2b532080d8
21 changed files with 8 additions and 6 deletions

View File

@ -25,6 +25,8 @@
--font-code: "Iosevka Fixed Web", "Iosevka Nerd Font", Iosevka, monospace;
}
[x-cloak] { display: none !important; }
:root {
--c-bg: #121212;
--c-text: rgb(200, 200, 200);

View File

@ -24,13 +24,13 @@ const { showSidebarButton = true, version = "latest" } = Astro.props;
Learn
</a>
<a
href="/api/std/"
href={`/en/${version}/api/std/`}
class="hidden sm:inline-block px-4 font-display font-bold-text-xl hover:underline"
>
Standard Library
</a>
<a
href="/spec/"
href={`/en/${version}/spec/`}
class="hidden sm:inline-block px-4 font-display font-bold-text-xl hover:underline"
>
Language spec

View File

@ -129,9 +129,6 @@ const rc = url_components[1] ?? "";
>
<nav class="py-4 pr-2 overflow-x-scroll h-[calc(100vh-3rem)]">
<div class="mb-2 relative" x-data="{open: false}">
<div>
<span> Language version: </span>
</div>
<button
class="bg-c-bg text-c-text border border-c-primary rounded px-3 w-full font-mono mt-2 flex items-center hover:dark:bg-zinc-800 transition-colors cursor-pointer text-left"
@click="open = !open"
@ -152,6 +149,7 @@ const rc = url_components[1] ?? "";
</svg>
</button>
<div
x-cloak
x-bind:class="open? '': 'hidden'"
class="bottom-0 w-full absolute"
>

View File

@ -9,7 +9,8 @@ const posts = (await Astro.glob(
)) as unknown as Array<AstroFile>;
// The base of every URL under this glob
const base_url = "/spec";
const version = "latest";
const base_url = `/en/${version}/spec`;
---
<NewDocsLayout
@ -17,6 +18,7 @@ const base_url = "/spec";
frontmatter={frontmatter}
headings={headings}
posts={posts}
version={version}
>
<slot />
</NewDocsLayout>