completed sidebar base
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
const { frontmatter } = Astro.props;
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
const title = frontmatter.title + "| Docs";
|
||||
const unsortedDocs = await Astro.glob("../pages/docs/*/*.mdx");
|
||||
const docs = unsortedDocs
|
||||
.sort((a, b) => +new Date(b.frontmatter.date) - +new Date(a.frontmatter.date))
|
||||
.filter((doc) => doc.frontmatter.repo === frontmatter.repo);
|
||||
---
|
||||
|
||||
<Layout
|
||||
@@ -20,8 +24,16 @@ const title = frontmatter.title + "| Docs";
|
||||
<hr />
|
||||
<br />
|
||||
<slot />
|
||||
<div class="sidebar">
|
||||
<a href={"/docs/" + frontmatter.repo}>{frontmatter.repo}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<a href={"/docs/" + frontmatter.repo}>Home</a><br />
|
||||
{
|
||||
docs.map((page) => (
|
||||
<>
|
||||
<a href={page.url}>{page.frontmatter.title}</a>
|
||||
<br />
|
||||
</>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
const { title } = Astro.props;
|
||||
@@ -17,20 +17,22 @@ import { ViewTransitions } from "astro:transitions";
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="darkreader-lock" />
|
||||
<meta name="description" content={description} />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title} | vaporvee's Website</title>
|
||||
<ViewTransitions />
|
||||
</head>
|
||||
<body>
|
||||
<Navbar />
|
||||
<slot />
|
||||
<br />
|
||||
<Footer />
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="darkreader-lock" />
|
||||
<meta name="description" content={description} />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title} | vaporvee's Website</title>
|
||||
<ViewTransitions />
|
||||
</head>
|
||||
<body>
|
||||
<Navbar />
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
<br />
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user