27 lines
660 B
Plaintext
27 lines
660 B
Plaintext
---
|
|
import { astroI18n } from "astro-i18n";
|
|
astroI18n.init(Astro);
|
|
|
|
import { getCollection } from "astro:content";
|
|
import EditorialContent from "../../components/EditorialContent.astro";
|
|
|
|
import BaseLayout from "../../layouts/BaseLayout.astro";
|
|
|
|
export async function getStaticPaths() {
|
|
const articles = await getCollection("articles", ({ data }) => {
|
|
return data.lang === astroI18n.langCode;
|
|
});
|
|
return articles.map((article) => ({
|
|
params: { slug: article.slug },
|
|
props: { article },
|
|
}));
|
|
}
|
|
|
|
const { article } = Astro.props;
|
|
---
|
|
|
|
<BaseLayout pageTitle={article.data.title}>
|
|
{article.data.lang}
|
|
<EditorialContent content={article} />
|
|
</BaseLayout>
|