split tutorial into multiple pages

+ improve layout a bit
This commit is contained in:
Felix Roos 2022-12-20 21:38:08 +01:00
parent b8f991eddb
commit b1202fcd55
11 changed files with 1087 additions and 72 deletions

View file

@ -17,7 +17,7 @@ type Props = {
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 currentFile = `src/pages${currentPage.replace(/\/$/, '')}.mdx`;
const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
---
@ -31,12 +31,12 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
</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">
<div class="max-w-full m-auto h-full space-y-4 flex flex-col">
<header class="max-w-full px-4">
<Header currentPage={currentPage} />
</header>
<main class="flex space-x-4 overflow-hidden relative">
<aside title="Site Navigation">
<aside title="Site Navigation" class="min-w-[300px] px-4">
<LeftSidebar currentPage={currentPage} />
</aside>
<div class="h-full grow overflow-auto px-2">
@ -44,7 +44,7 @@ const githubEditUrl = `${CONFIG.GITHUB_EDIT_URL}/${currentFile}`;
<slot />
</PageContent>
</div>
<aside class="w-2xl flex-none h-full overflow-auto px-4" title="Table of Contents">
<aside class="w-2xl flex-none h-full overflow-auto pr-8 pl-0" title="Table of Contents">
<RightSidebar headings={headings} githubEditUrl={githubEditUrl} />
</aside>
</main>