1
0
Fork 0
mirror of https://github.com/TheTaz25/denis.ergin.git synced 2025-07-07 06:08:53 +00:00

chore: apply last content changes for astro 5

This commit is contained in:
Denis Ergin 2025-06-20 19:08:01 +02:00
parent dcd9a85391
commit 0d72c0850c

View file

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