feat: add madeira blog post upgrade astro
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
---
|
||||
import { getCollection } from "astro:content";
|
||||
import { getCollection, render } from "astro:content";
|
||||
import { getLocale } from "astro-i18n-aut";
|
||||
import { filterCollection, parseSlug } from "@i18n/utils";
|
||||
|
||||
const locale = getLocale(Astro.url);
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const pages = await getCollection("blog");
|
||||
const posts = await getCollection("blog");
|
||||
|
||||
const paths = pages.map((page) => {
|
||||
const [slug] = parseSlug(page.id);
|
||||
return { params: { slug }, props: { ...page } };
|
||||
const paths = posts.map((post) => {
|
||||
const [slug] = parseSlug(post.id);
|
||||
return { params: { slug }, props: { ...post } };
|
||||
});
|
||||
|
||||
return paths;
|
||||
@@ -28,7 +28,7 @@ if (!page) {
|
||||
});
|
||||
}
|
||||
|
||||
const { Content } = await page.render();
|
||||
const { Content } = await render(page);
|
||||
---
|
||||
|
||||
<Content />
|
||||
|
||||
Reference in New Issue
Block a user