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.
23 lines
597 B
Plaintext
23 lines
597 B
Plaintext
---
|
|
import Base from './Base.astro'
|
|
|
|
const years = await Astro.glob('../pages/archivio/*/index.md')
|
|
const currentYear = years
|
|
.map(module => module.file.split('/').at(-2))
|
|
.toSorted()
|
|
.at(-1)
|
|
const {
|
|
file,
|
|
frontmatter: { title },
|
|
} = Astro.props
|
|
const selectedCourseLabel = file.split('/').at(-1)
|
|
|
|
const allCourses = await Astro.glob(`../pages/archivio/*/*`)
|
|
const courses = allCourses.filter(module => module.file.includes(file.split('/').at(-2)))
|
|
---
|
|
|
|
<Base title={title} courses={courses} selectedCourseLabel={selectedCourseLabel}>
|
|
<h1>{title}</h1>
|
|
<slot />
|
|
</Base>
|