on master help sign in
individual events pages and separate event pages into current vs

previous

commit3ee8f877bc125dadcbca023f6e1b380048813273 authorGavin Atkinson <gvnatknsn@protonmail.com> dateWed 16 Jun 2021, 16:33 (5 years ago) parent705352b
2 files changed+5−8
pages/events.js+1−4 pages/events/[slug].js+4−4
pages/events.js+1−4
@@ -95,10 +95,7 @@ export default function Events({ pastEvents, currentEvents }) {
9595}
9696
9797export async function getStaticProps() {
98− const posts = getAllPosts(
99− ["title", "slug", "date", "description", "extra"],
100− "events"
101− );
98+ const posts = getAllPosts(["title", "slug", "date", "extra"], "events");
10299
103100 // NB Gavin: This logic can change based on how we want to separate past vs current events
104101 const pastEvents = posts.filter((post) => !post.extra.pinned);
pages/events/[slug].js+4−4
@@ -109,20 +109,20 @@ export async function getStaticProps({ params }) {
109109 getNextPost(
110110 params.slug,
111111 ["title", "slug", "date", "description", "extra"],
112− "blog"
112+ "events"
113113 ) || null;
114114
115115 const previousPost =
116116 getPreviousPost(
117117 params.slug,
118118 ["title", "slug", "date", "description", "extra"],
119− "blog"
119+ "events"
120120 ) || null;
121121
122122 const post = getPostBySlug(
123123 params.slug,
124124 ["title", "slug", "date", "description", "content", "extra"],
125− "blog"
125+ "events"
126126 );
127127
128128 return {
@@ -131,7 +131,7 @@ export async function getStaticProps({ params }) {
131131}
132132
133133export async function getStaticPaths() {
134− const posts = getAllPosts(["slug", "date"], "blog");
134+ const posts = getAllPosts(["slug", "date"], "events");
135135
136136 return {
137137 paths: posts.map((post) => {