Playing around with options for base structure and navigation

This commit is contained in:
2025-07-03 23:50:20 -07:00
parent 65e05066ea
commit d515e581b5
26 changed files with 1075 additions and 398 deletions

View File

@@ -1,18 +0,0 @@
---
import {getCollection, render} from 'astro:content';
import BaseLayout from "../../layouts/BaseLayout.astro";
// 1. Generate a new path for every collection entry
export async function getStaticPaths() {
const projects = await getCollection('projects');
return projects.map(project => ({
params: {id: project.id},
props: {project: project},
}));
}
// 2. For your template, you can get the entry directly from the prop
const {project} = Astro.props;
const {Content} = await render(project);
---
<BaseLayout title={project.id}>
<Content/>
</BaseLayout>

View File

@@ -0,0 +1,6 @@
---
import BaseLayout from '../../layouts/BaseLayout.astro';
---
<BaseLayout>
</BaseLayout>