diff --git a/src/components/ApiLayout/Sidebar.astro b/src/components/ApiLayout/Sidebar.astro
index 5ed16d0..81290b6 100644
--- a/src/components/ApiLayout/Sidebar.astro
+++ b/src/components/ApiLayout/Sidebar.astro
@@ -4,12 +4,20 @@ import { splitAndLast } from "../utils";
const hierarchy: Hierarchy = Astro.props.hierarchy;
-export function postComparison(a: Post, b: Post): number {
+function postComparison(a: Post, b: Post): number {
const s1 = splitAndLast(a.url);
const s2 = splitAndLast(b.url);
return s1 > s2 ? 0 : 1;
}
+
+function appendSlash(s: string): string {
+ if (s.endsWith("/")) {
+ return s;
+ } else {
+ return s + "/";
+ }
+}
---
{
@@ -19,7 +27,7 @@ export function postComparison(a: Post, b: Post): number {
{folderPost !== null ? (
{splitAndLast(folderPost.url)}
@@ -42,7 +50,7 @@ export function postComparison(a: Post, b: Post): number {
hierarchy.posts.sort(postComparison).map((p) => (
{splitAndLast(p.url)}
diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro
index 8b9c34a..dda8e7b 100644
--- a/src/components/Navbar.astro
+++ b/src/components/Navbar.astro
@@ -26,19 +26,19 @@ const { showSidebarButton = true } = Astro.props;
Learn
Language spec
std reference
@@ -56,7 +56,6 @@ const { showSidebarButton = true } = Astro.props;
}
sidebarToggle.addEventListener("click", () => {
- console.log(":D");
sidebar.classList.toggle("-translate-x-64");
console.log(sidebar.classList.contains("-translate-x-64"));
});