-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy path[...slug].astro
33 lines (28 loc) · 1.18 KB
/
[...slug].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
---
import type { InferGetStaticPropsType } from 'astro';
import TopBarWrapper from '../components/TopBarWrapper.astro';
import MainContainer from '../components/MainContainer.astro';
import PageLoadingIndicator from '../components/PageLoadingIndicator.astro';
import Layout from '../layouts/Layout.astro';
import '../styles/base.css';
import '@tutorialkit/custom.css';
import { generateStaticRoutes } from '../utils/routes';
export async function getStaticPaths() {
return generateStaticRoutes();
}
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
const { lesson, logoLink, navList, title } = Astro.props as Props;
const meta = lesson.data?.meta ?? {};
// use lesson's default title and a default description for SEO metadata
meta.title ??= title;
meta.description ??= 'A TutorialKit interactive lesson';
Astro.locals.tk = { lesson };
---
<Layout title={title} meta={meta}>
<PageLoadingIndicator />
<div id="previews-container"></div>
<main class="max-w-full flex flex-col h-full overflow-hidden" data-swap-root>
<TopBarWrapper logoLink={logoLink ?? '/'} openInStackBlitz={lesson.data.openInStackBlitz} />
<MainContainer lesson={lesson} navList={navList} />
</main>
</Layout>