diff --git a/.gitignore b/.gitignore index 238e770b..922d92a5 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ # debug npm-debug.log* yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log* diff --git a/content/events/2021/fall/.gitkeep b/content/events/2021/fall/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/content/events/2021/winter/.gitkeep b/content/events/2021/winter/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/pages/events/[year]/index.tsx b/pages/events/[year]/index.tsx new file mode 100644 index 00000000..120b8a7a --- /dev/null +++ b/pages/events/[year]/index.tsx @@ -0,0 +1,69 @@ +import React from "react"; + +import { Link } from "../../../components/Link"; +import { getEventYears, getEventTermsByYear } from "../../../lib/events"; + +import styles from "./year.module.css"; + +export async function getStaticPaths(): Promise<{ + paths: { + params: { + year: string; + }; + }[]; + fallback: boolean; +}> { + const years = await getEventYears(); + const paths = years.map((curYear) => ({ + params: { year: curYear }, + })); + return { + paths: paths, + fallback: false, + }; +} + +interface Context { + params: { + year: string; + }; +} + +export async function getStaticProps(context: Context): Promise<{ + props: { + year: string; + terms: string[]; + }; +}> { + return { + props: { + year: context.params.year, + terms: await getEventTermsByYear(context.params.year), + }, + }; +} + +interface Props { + year: string; + terms: string[]; +} + +const Year = (props: Props) => { + return ( +
+

+ Events Archive:{` ${props.year}`} +

+
+
+ {props.terms.map((term) => ( + + {`${term.charAt(0).toUpperCase()}${term.slice(1)}`} + + ))} +
+
+ ); +}; + +export default Year; diff --git a/pages/events/[year]/year.module.css b/pages/events/[year]/year.module.css new file mode 100644 index 00000000..f9f1d266 --- /dev/null +++ b/pages/events/[year]/year.module.css @@ -0,0 +1,27 @@ +.main { + margin: auto; + margin-top: 7rem; + margin-bottom: 14rem; + width: 50rem; +} + +.heading2 { + font-weight: 700; + font-size: 2.25rem; + color: var(--primary-heading); +} + +.blue { + color: var(--primary-accent) +} + +.links { + display: flex; + flex-direction: column; +} + +.links > * { + font-weight: 400; + font-size: 16px; + margin-top: 30px; +} \ No newline at end of file