/events/year/term/event title has 'Term - year' in it
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Aditya Thakral 2021-08-30 12:15:01 -04:00
parent 82e6318f9e
commit 1751b312c0
1 changed files with 11 additions and 6 deletions

View File

@ -13,23 +13,26 @@ import {
getEventsByTerm,
getEventBySlug,
} from "@/lib/events";
import { capitalize } from "@/utils";
export default function EventInfoPage(props: Props) {
export default function EventInfoPage({ year, term, event }: Props) {
return (
<>
<Title>{props.event.metadata.name}</Title>
<Title>{[event.metadata.name, `${capitalize(term)} ${year}`]}</Title>
<EventCard
{...props.event.metadata}
date={new Date(props.event.metadata.date)}
{...event.metadata}
date={new Date(event.metadata.date)}
showDescription
>
<MDXRemote {...props.event.content} />
<MDXRemote {...event.content} />
</EventCard>
</>
);
}
interface Props {
year: string;
term: string;
event: Event;
}
@ -44,7 +47,9 @@ export const getStaticProps: GetStaticProps<Props, Params> = async (
) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { year, term, event } = context.params!;
return { props: { event: await getEventBySlug(year, term, event) } };
return {
props: { year, term, event: await getEventBySlug(year, term, event) },
};
};
export const getStaticPaths: GetStaticPaths<Params> = async () => {