diff options
Diffstat (limited to 'docs/src/layouts/ExamplesLayout.astro')
-rw-r--r-- | docs/src/layouts/ExamplesLayout.astro | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/docs/src/layouts/ExamplesLayout.astro b/docs/src/layouts/ExamplesLayout.astro new file mode 100644 index 000000000..e1315b362 --- /dev/null +++ b/docs/src/layouts/ExamplesLayout.astro @@ -0,0 +1,129 @@ +---
+import HeadCommon from "../components/HeadCommon.astro";
+import HeadSEO from "../components/HeadSEO.astro";
+import Header from '../components/Header/Header.astro';
+import Footer from '../components/Footer/Footer.astro';
+import PageContent from '../components/PageContent/PageContent.astro';
+import LeftSidebar from '../components/LeftSidebar/LeftSidebar.astro';
+import MoreMenu from '../components/RightSidebar/MoreMenu.astro'
+import { SITE } from "../config.ts";
+import ContainerQuery from '../components/ContainerQuery.astro'
+const { content = {}, page= Astro.request.url.pathname } = Astro.props;
+const currentPage =page;
+// const currentFile = `src/pages${currentPage.replace(/\/$/, "")}.md`;
+const githubEditUrl = `https://github.com/snowpackjs/astro/blob/main/docs/${page}`;
+---
+
+<html dir="{content.dir ?? 'ltr'}" lang="{content.lang ?? 'en-us'}" class="initial">
+ <head>
+ <HeadCommon />
+ <HeadSEO {content} canonicalURL={Astro.request.canonicalURL} />
+ <!--TODO: Insert font-awesome icons -->
+ <title>{content.title ? `${content.title} 🚀 ${SITE.title}` : SITE.title}</title>
+ <style>
+ body {
+ width: 100%;
+ display: grid;
+ grid-template-rows: var(--theme-navbar-height) 1fr;
+ --gutter: 0.5rem;
+ --doc-padding: 2rem;
+ }
+ pre{
+ margin-top: 2%;
+ }
+ .layout {
+ display: grid;
+ grid-auto-flow: column;
+ grid-template-columns:
+ minmax(var(--gutter), 1fr)
+ minmax(0, var(--max-width))
+ minmax(var(--gutter), 1fr);
+ overflow-x: hidden;
+ }
+ .layout :global(> *) {
+ width: 100%;
+ height: 100%;
+ }
+ .grid-sidebar {
+ height: 100vh;
+ position: sticky;
+ top: 0;
+ padding: 0;
+ }
+ #grid-left {
+ position: fixed;
+ background-color: var(--theme-bg);
+ z-index: 10;
+ display: none;
+ }
+ #grid-main {
+ padding: var(--doc-padding) var(--gutter);
+ grid-column: 2;
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+ }
+ #grid-right {
+ display: none;
+ }
+ :global(.mobile-sidebar-toggle) {
+ overflow: hidden;
+ }
+ :global(.mobile-sidebar-toggle) #grid-left {
+ display: block;
+ top: 2rem;
+ }
+ @media (min-width: 50em) {
+ .layout {
+ overflow: initial;
+ grid-template-columns:
+ 20rem
+ minmax(0, var(--max-width));
+ gap: 1em;
+ }
+ #grid-left {
+ display: flex;
+ padding-left: 2rem;
+ position: sticky;
+ grid-column: 1;
+ }
+ }
+
+ @media (min-width: 72em) {
+ .layout {
+ grid-template-columns:
+ 20rem
+ minmax(0, var(--max-width))
+ 18rem;
+ padding-left: 0;
+ padding-right: 0;
+ margin: 0 auto;
+ }
+ #grid-right {
+ grid-column: 3;
+ display: flex;
+ }
+ }
+ </style>
+ <ContainerQuery/>
+ </head>
+
+ <body>
+ <Header currentPage={currentPage} />
+ <main class="layout">
+ <aside id="grid-left" class="grid-sidebar" title="Site Navigation">
+ <LeftSidebar currentPage={currentPage} />
+ </aside>
+ <div id="grid-main">
+ <slot />
+ </div>
+ <aside id="grid-right" class="grid-sidebar" title="Table of Contents">
+ <nav class="sidebar-nav" aria-labelledby="grid-right">
+ <div class="sidebar-nav-inner">
+ <MoreMenu editHref={githubEditUrl} />
+ </div>
+ </nav>
+ </aside>
+ </main>
+ </body>
+</html>
|