Upload and test
This commit is contained in:
12
00-Lesson-Site/frontend/src/pages/changelog.astro
Normal file
12
00-Lesson-Site/frontend/src/pages/changelog.astro
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
// Path: src/pages/changelog.astro
|
||||
|
||||
import Layout from "../layouts/LessonLayout.astro";
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<h1>Welcome to the Lesson Site</h1>
|
||||
<p>This is the homepage of the lesson site built with Astro.</p>
|
||||
|
||||
<a href="/lessons/01-intro">Lesson 1</a>
|
||||
</Layout>
|
||||
12
00-Lesson-Site/frontend/src/pages/index.astro
Normal file
12
00-Lesson-Site/frontend/src/pages/index.astro
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
// Path: 00-Lesson-Site/src/pages/index.astro
|
||||
|
||||
import Layout from "../layouts/LessonLayout.astro";
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<h1>Welcome to the Lesson Site</h1>
|
||||
<p>This is the homepage of the lesson site built with Astro.</p>
|
||||
|
||||
<a href="/lessons/01-intro">Lesson 1</a>
|
||||
</Layout>
|
||||
35
00-Lesson-Site/frontend/src/pages/lessons/[slug].astro
Normal file
35
00-Lesson-Site/frontend/src/pages/lessons/[slug].astro
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
// Path: src/pages/lessons/[slug].astro
|
||||
|
||||
import { getCollection, type CollectionEntry } from "astro:content";
|
||||
import LessonLayout from "../../layouts/LessonLayout.astro";
|
||||
|
||||
import styles from "./lessonPage.module.scss";
|
||||
|
||||
interface Props {
|
||||
entry: CollectionEntry<"lessons">;
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const lessonEntries = await getCollection("lessons");
|
||||
|
||||
return lessonEntries.map((entry: CollectionEntry<"lessons">) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
|
||||
// Dynamically Import Lesson Style from the entry's frontmatter
|
||||
if (entry.data.style) {
|
||||
await import(`../../styles/lessons/${entry.data.style}.scss`);
|
||||
}
|
||||
---
|
||||
|
||||
<LessonLayout pageTitle={entry.data.title}>
|
||||
<div class:list={[styles.content]} id="lesson-container">
|
||||
<Content />
|
||||
</div>
|
||||
</LessonLayout>
|
||||
12
00-Lesson-Site/frontend/src/pages/lessons/index.astro
Normal file
12
00-Lesson-Site/frontend/src/pages/lessons/index.astro
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
// Path: src/pages/lessons/index.astro
|
||||
|
||||
import Layout from "../../layouts/LessonLayout.astro";
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<h1>Welcome to the Lesson Site</h1>
|
||||
<p>This is the homepage of the lesson site built with Astro.</p>
|
||||
|
||||
<a href="/lessons/01-intro">Lesson 1</a>
|
||||
</Layout>
|
||||
@@ -0,0 +1,11 @@
|
||||
/* Path: src/pages/lessons/lessonPage.module.scss */
|
||||
|
||||
.content {
|
||||
width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
12
00-Lesson-Site/frontend/src/pages/resources.astro
Normal file
12
00-Lesson-Site/frontend/src/pages/resources.astro
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
// Path: src/pages/resources.astro
|
||||
|
||||
import Layout from "../layouts/LessonLayout.astro";
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<h1>Welcome to the Lesson Site</h1>
|
||||
<p>This is the homepage of the lesson site built with Astro.</p>
|
||||
|
||||
<a href="/lessons/01-intro">Lesson 1</a>
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user