basic astro docs
This commit is contained in:
parent
61657bd1b1
commit
bc7a84e462
48 changed files with 14926 additions and 2 deletions
51
website/src/layouts/MainLayout.astro
Normal file
51
website/src/layouts/MainLayout.astro
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
import HeadCommon from '../components/HeadCommon.astro';
|
||||
import HeadSEO from '../components/HeadSEO.astro';
|
||||
import Header from '../components/Header/Header.astro';
|
||||
import PageContent from '../components/PageContent/PageContent.astro';
|
||||
import LeftSidebar from '../components/LeftSidebar/LeftSidebar.astro';
|
||||
import RightSidebar from '../components/RightSidebar/RightSidebar.astro';
|
||||
import * as CONFIG from '../config';
|
||||
import type { MarkdownHeading } from 'astro';
|
||||
import Footer from '../components/Footer/Footer.astro';
|
||||
|
||||
type Props = {
|
||||
frontmatter: CONFIG.Frontmatter;
|
||||
headings: MarkdownHeading[];
|
||||
};
|
||||
|
||||
const { frontmatter, headings } = Astro.props as Props;
|
||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||
const currentPage = Astro.url.pathname;
|
||||
const currentFile = `src/pages${currentPage.replace(/\/$/, '')}.md`;
|
||||
const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
|
||||
---
|
||||
|
||||
<html dir={frontmatter.dir ?? 'ltr'} lang={frontmatter.lang ?? 'en-us'} class="initial">
|
||||
<head>
|
||||
<HeadCommon />
|
||||
<HeadSEO frontmatter={frontmatter} canonicalUrl={canonicalURL} />
|
||||
<title>
|
||||
{frontmatter.title ? `${frontmatter.title} 🚀 ${CONFIG.SITE.title}` : CONFIG.SITE.title}
|
||||
</title>
|
||||
</head>
|
||||
|
||||
<body class="h-screen">
|
||||
<div class="max-w-[1000px] m-auto h-full space-y-4 flex flex-col">
|
||||
<header class="max-w-full">
|
||||
<Header currentPage={currentPage} />
|
||||
</header>
|
||||
<main class="flex space-x-4 overflow-hidden relative">
|
||||
<main class="h-full grow overflow-auto px-2">
|
||||
<PageContent frontmatter={frontmatter} headings={headings} githubEditUrl={githubEditUrl}>
|
||||
<slot />
|
||||
</PageContent>
|
||||
</main>
|
||||
<aside class="w-2xl flex-none h-full overflow-auto px-4" title="Table of Contents">
|
||||
<RightSidebar headings={headings} githubEditUrl={githubEditUrl} />
|
||||
</aside>
|
||||
</main>
|
||||
<!-- <Footer path={currentFile} /> -->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue