@@ -4,9 +4,10 @@ import HeadSEO from "../components/HeadSEO.astro"
44import Header from " ../components/Header/Header.astro"
55import * as CONFIG from " ../config"
66import Footer from " ~/components/Footer/Footer"
7+ import LeftSidebar from " ../components/LeftSidebar/LeftSidebar.astro"
78
89const { content = {}, dark } = Astro .props
9-
10+ const currentPage = new URL ( Astro . request . url ). pathname
1011const formattedContentTitle = content .title
1112 ? ` ${content .title } | ${CONFIG .SITE .title } `
1213 : ` ${CONFIG .PAGE .titleFallback } | ${CONFIG .SITE .title } `
@@ -18,17 +19,55 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site)
1819 <HeadCommon />
1920 <HeadSEO content ={ content } canonicalURL ={ canonicalURL } site =" " />
2021 <title >{ formattedContentTitle } </title >
22+ <style >
23+ body {
24+ --doc-padding: 65px;
25+ }
26+ .home-layout {
27+ margin-bottom: 0;
28+ }
29+
30+ #grid-left {
31+ position: fixed;
32+ background-color: var(--theme-bg);
33+ z-index: 10;
34+ display: none;
35+ }
36+
37+ @media (min-width: 50em) {
38+ #grid-left {
39+ display: flex;
40+ position: sticky;
41+ grid-column: 1;
42+ background: transparent;
43+ }
44+ }
45+ </style >
2146 <style is:global >
2247 .search-item {
2348 display: none !important;
2449 }
50+ .mobile-sidebar-toggle {
51+ overflow: hidden;
52+ }
53+
54+ .mobile-sidebar-toggle #grid-left {
55+ display: block;
56+ top: 2rem;
57+ left: 0;
58+ padding: 0 20px;
59+ height: calc(100vh - 2rem);
60+ }
2561 </style >
2662 </head >
2763</html >
2864
2965<body >
3066 <Header dark ={ dark } />
31- <main >
67+ <aside id =" grid-left" class =" grid-sidebar" title =" Site Navigation" >
68+ <LeftSidebar currentPage ={ currentPage } {content } />
69+ </aside >
70+ <main class =" home-layout" >
3271 <slot />
3372 </main >
3473 <Footer />
0 commit comments