mirror of
https://github.com/liyunze-coding/coworking-website.git
synced 2026-11-06 21:23:33 +00:00
48 lines
1.5 KiB
Text
48 lines
1.5 KiB
Text
---
|
|
import Layout from "./Layout.astro";
|
|
import TableOfContent from "../components/blocks/TableOfContent.astro";
|
|
import VerticalNav from "../components/blocks/verticalNav.astro";
|
|
import "../assets/styles/remark-callout-directives.css";
|
|
|
|
const { frontmatter, headings } = Astro.props;
|
|
---
|
|
|
|
<Layout title={frontmatter.title} description={frontmatter.description}>
|
|
<div class="mx-auto px-2 max-w-[1440px]">
|
|
<div class="flex flex-col lg:grid lg:grid-cols-10 gap-5">
|
|
<!-- vertical navbar -->
|
|
<div
|
|
class="lg:col-span-2 lg:px-4"
|
|
transition:name="vertical-navbar"
|
|
>
|
|
<aside
|
|
class="hidden lg:translate-x-0 overflow-y-auto z-30 lg:block lg:sticky py-8 lg:max-h-[calc(100vh-var(--header-height))] lg:top-[--header-height]"
|
|
>
|
|
<VerticalNav />
|
|
</aside>
|
|
</div>
|
|
<div class="lg:col-span-8">
|
|
<div class="flex flex-col lg:grid lg:grid-cols-10">
|
|
<div class="col-span-8 px-2 md:px-10 pb-10 pt-8">
|
|
<slot />
|
|
</div>
|
|
<div
|
|
class="hidden col-span-2 pt-8 lg:block lg:sticky lg:px-4 lg:-mx-4 lg:max-h-[calc(100vh-var(--header-height))] lg:top-[--header-height]"
|
|
>
|
|
<!-- TOC -->
|
|
<TableOfContent
|
|
headings={headings}
|
|
path={frontmatter.path}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script is:inline>
|
|
// make all <a> attributes have target="_blank" except for Table of Contents
|
|
document.querySelectorAll("a:not(.no-target-blank)").forEach((el) => {
|
|
el.setAttribute("target", "_blank");
|
|
});
|
|
</script>
|
|
</Layout>
|