You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
708 B
Plaintext

---
export async function getStaticPaths() {
const years = await Astro.glob("./archivio/*/index.md");
const currentYear = years
.map((module) => module.file.split("/").at(-2))
.toSorted()
.at(-1);
const allCourses = await Astro.glob(`./archivio/*/*`);
const courses = allCourses.filter((module) => module.file.includes(currentYear));
return courses.map((module) => {
const course = module.file.split("/").at(-1).split(".")[0];
return {
params: {
course,
},
props: {
module,
},
};
});
}
const {
module: { Content },
} = Astro.props;
---
<Content />