jalil.arfaoui.net/src/pages/en/code/projects/[slug].astro

19 lines
623 B
Text
Raw Normal View History

---
import ProjectDetailContent from '../../../../components/code/ProjectDetailContent.astro';
import { getCollection } from 'astro:content';
import { getProjectBaseSlug } from '../../../../utils/i18n';
export async function getStaticPaths() {
const allProjects = await getCollection('projects');
const enProjects = allProjects.filter(p => p.data.lang === 'en' && !p.data.draft && p.data.category === 'dev');
return enProjects.map(project => ({
params: { slug: getProjectBaseSlug(project.id) },
props: { project },
}));
}
const { project } = Astro.props;
---
<ProjectDetailContent project={project} lang="en" />