chore(astro): upgrade to astro 6 with legacy content compatibility
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
import { getCollection, render } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("glossaire");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
params: { slug: String(entry.id).replace(/\.(md|mdx)$/i, "") },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
const { Content } = await render(entry);
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
@@ -26,4 +26,4 @@ const { Content } = await entry.render();
|
||||
<h1>{entry.data.term}</h1>
|
||||
<p><em>{entry.data.definitionShort}</em></p>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
</EditionLayout>
|
||||
@@ -5,11 +5,17 @@ import { getCollection } from "astro:content";
|
||||
const entries = await getCollection("glossaire");
|
||||
entries.sort((a, b) => a.data.term.localeCompare(b.data.term, "fr"));
|
||||
---
|
||||
|
||||
<SiteLayout title="Glossaire archicratique">
|
||||
<h1>Glossaire archicratique</h1>
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={`/glossaire/${e.slug}/`}>{e.data.term}</a> — <em>{e.data.definitionShort}</em></li>
|
||||
<li>
|
||||
<a href={`/glossaire/${String(e.id).replace(/\.(md|mdx)$/i, "")}/`}>
|
||||
{e.data.term}
|
||||
</a>{" "}
|
||||
— <em>{e.data.definitionShort}</em>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
</SiteLayout>
|
||||
Reference in New Issue
Block a user