on master help sign in
individual events pages and separate event pages into current vs
3ee8f87Gavin Atkinson
pages/events.js+1−4
@@ -95,10 +95,7 @@ export default function Events({ pastEvents, currentEvents }) {
95}
95}
96
96
97export async function getStaticProps() {
97export async function getStaticProps() {
98− const posts = getAllPosts(
98+ const posts = getAllPosts(["title", "slug", "date", "extra"], "events");
99− ["title", "slug", "date", "description", "extra"],
100− "events"
101− );
102
99
103 // NB Gavin: This logic can change based on how we want to separate past vs current events
100 // NB Gavin: This logic can change based on how we want to separate past vs current events
104 const pastEvents = posts.filter((post) => !post.extra.pinned);
101 const pastEvents = posts.filter((post) => !post.extra.pinned);
pages/events/[slug].js+4−4
@@ -109,20 +109,20 @@ export async function getStaticProps({ params }) {
109 getNextPost(
109 getNextPost(
110 params.slug,
110 params.slug,
111 ["title", "slug", "date", "description", "extra"],
111 ["title", "slug", "date", "description", "extra"],
112− "blog"
112+ "events"
113 ) || null;
113 ) || null;
114
114
115 const previousPost =
115 const previousPost =
116 getPreviousPost(
116 getPreviousPost(
117 params.slug,
117 params.slug,
118 ["title", "slug", "date", "description", "extra"],
118 ["title", "slug", "date", "description", "extra"],
119− "blog"
119+ "events"
120 ) || null;
120 ) || null;
121
121
122 const post = getPostBySlug(
122 const post = getPostBySlug(
123 params.slug,
123 params.slug,
124 ["title", "slug", "date", "description", "content", "extra"],
124 ["title", "slug", "date", "description", "content", "extra"],
125− "blog"
125+ "events"
126 );
126 );
127
127
128 return {
128 return {
@@ -131,7 +131,7 @@ export async function getStaticProps({ params }) {
131}
131}
132
132
133export async function getStaticPaths() {
133export async function getStaticPaths() {
134− const posts = getAllPosts(["slug", "date"], "blog");
134+ const posts = getAllPosts(["slug", "date"], "events");
135
135
136 return {
136 return {
137 paths: posts.map((post) => {
137 paths: posts.map((post) => {