forked from www/www-new
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
545 B
18 lines
545 B
import { GetStaticProps } from "next";
|
|
|
|
import { ArchivePage, Props } from "@/components/ArchivePage";
|
|
import { getEventTermsByYear, getEventYears } from "@/lib/events";
|
|
|
|
export default ArchivePage;
|
|
|
|
export const getStaticProps: GetStaticProps<Props> = async () => {
|
|
const years = (await getEventYears()).reverse();
|
|
const yearsWithTerms = await Promise.all(
|
|
years.map(async (year) => ({
|
|
year,
|
|
terms: (await getEventTermsByYear(year)).reverse(),
|
|
}))
|
|
);
|
|
|
|
return { props: { items: yearsWithTerms, type: "events" } };
|
|
};
|
|
|