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:
parent
dcd9a85391
commit
0d72c0850c
1 changed files with 3 additions and 3 deletions
|
@ -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}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue