forked from mickasmt/astro-nomy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-layout.astro
64 lines (57 loc) · 1.81 KB
/
main-layout.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
import Footer from "@/components/layout/footer.astro";
import Header from "@/components/layout/header.astro";
import { MainNavigationMenu } from "@/components/main-navigation-menu";
import { cn } from "@/lib/utils";
import BaseLayout from "./base-layout.astro";
import { SheetMobileNav } from "@/components/layout/sheet-mobile-nav";
import { navMenuConfig } from "@/config/nav-menu";
import { ThemeToggle } from "@/components/theme-toggle";
import { siteConfig } from "@/config/site";
import { Icon } from "astro-icon/components";
// import { marketingConfig } from "@/config/marketing";
// import MainNav from "@/components/layout/main-nav.astro";
type Props = {
title: string;
description?: string;
mainClass?: string;
};
const { title, description, mainClass } = Astro.props;
---
<BaseLayout title={title} description={description}>
<Header className="border-b">
<!-- if using only normals links -->
<!-- <MainNav items={marketingConfig.mainNav} slot="left-header" />
<SheetMobileNav
mainNavItems={marketingConfig.mainNav}
slot="mobile-nav-header"
client:load
/> -->
<!-- if use Navigation Menu on desktop -->
<MainNavigationMenu slot="left-header" client:load />
<SheetMobileNav
mainNavItems={[...navMenuConfig.links]}
sidebarNavItems={[
...navMenuConfig.infosNav,
...navMenuConfig.examplesNav,
]}
slot="mobile-nav-header"
client:load
/>
<div class="flex items-center gap-x-4" slot="right-header">
<a
href={siteConfig.links.github}
target="_blank"
rel="noreferrer"
aria-label="github"
>
<Icon name="github" class="size-[22px]" />
</a>
<ThemeToggle client:load />
</div>
</Header>
<main class={cn(mainClass)}>
<slot />
</main>
<Footer />
</BaseLayout>