---
import { astroI18n } from "astro-i18n";
import BaseLayout from "../../layouts/BaseLayout.astro";

export async function getStaticPaths({}) {
	const allPosts = await Astro.glob("../../data/articles/**/*.mdx");

	const localizedPost = allPosts.filter((post) => {
		return post.frontmatter.lang === astroI18n.langCode;
	});

	return localizedPost.map((post) => {
		return {
			params: { slug: post.frontmatter.slug },
			props: { post },
		};
	});
}

const { slug } = Astro.params;
const { post } = Astro.props;
---

<BaseLayout>
	{post.frontmatter.title}
</BaseLayout>
