on master help sign in
pages: specify sort
commita86bba208b2de2bec34d3ab7605be4cd8653f529 authorMatilde Park <matilde.park@urbit.org> dateTue 26 Apr 2022, 18:18 (5 years ago) parent81ac51d
10 files changed+15−15
pages/blog.js+2−1 pages/blog/[slug].js+1−1 pages/events/[slug].js+1−1 pages/grants.js+2−6 pages/grants/[slug].js+1−1 pages/index.js+2−1 pages/media.js+2−1 pages/media/[slug].js+1−1 pages/updates.js+2−1 pages/updates/[slug].js+1−1
pages/blog.js+2−1
@@ -86,7 +86,8 @@ export default function Blog({ posts, search }) {
8686export async function getStaticProps() {
8787 const posts = getAllPosts(
8888 ["title", "slug", "date", "description", "extra"],
89− "blog"
89+ "blog",
90+ "date"
9091 );
9192
9293 return {
pages/blog/[slug].js+1−1
@@ -113,7 +113,7 @@ export async function getStaticProps({ params }) {
113113}
114114
115115export async function getStaticPaths() {
116− const posts = getAllPosts(["slug", "date"], "blog");
116+ const posts = getAllPosts(["slug", "date"], "blog", "date");
117117
118118 return {
119119 paths: posts.map((post) => {
pages/events/[slug].js+1−1
@@ -169,7 +169,7 @@ export async function getStaticProps({ params }) {
169169}
170170
171171export async function getStaticPaths() {
172− const events = getAllPosts(["slug", "date"], "events");
172+ const events = getAllPosts(["slug", "date"], "events", "date");
173173
174174 return {
175175 paths: events.map((event) => {
pages/grants.js+2−6
@@ -463,12 +463,8 @@ export async function getStaticProps() {
463463 const types = getGrantsTypes();
464464 const posts = getAllPosts(
465465 ["title", "slug", "date", "description", "extra", "taxonomies"],
466− "grants"
467− );
468−
469− let updates = getAllPosts(
470− ["title", "slug", "date", "description", "extra", "taxonomies"],
471− "updates"
466+ "grants",
467+ "date"
472468 );
473469
474470 // The layout expects exactly 3
pages/grants/[slug].js+1−1
@@ -107,7 +107,7 @@ export async function getStaticProps({ params }) {
107107}
108108
109109export async function getStaticPaths() {
110− const posts = getAllPosts(["slug", "date"], "grants");
110+ const posts = getAllPosts(["slug", "date"], "grants", "date");
111111
112112 return {
113113 paths: posts.map((post) => {
pages/index.js+2−1
@@ -284,7 +284,8 @@ export async function getStaticProps() {
284284
285285 const posts = getAllPosts(
286286 ["title", "slug", "date", "description", "extra"],
287− "blog"
287+ "blog",
288+ "date"
288289 );
289290
290291 const events = getAllEvents(eventKeys, "events");
pages/media.js+2−1
@@ -100,7 +100,8 @@ export default function Media({ posts, search }) {
100100export async function getStaticProps() {
101101 const posts = getAllPosts(
102102 ["title", "slug", "date", "description", "extra"],
103− "media"
103+ "media",
104+ "date"
104105 );
105106
106107 return {
pages/media/[slug].js+1−1
@@ -103,7 +103,7 @@ export async function getStaticProps({ params }) {
103103}
104104
105105export async function getStaticPaths() {
106− const posts = getAllPosts(["slug", "date"], "media");
106+ const posts = getAllPosts(["slug", "date"], "media", "date");
107107
108108 return {
109109 paths: posts.map((post) => {
pages/updates.js+2−1
@@ -73,7 +73,8 @@ export default function Updates({ posts, search }) {
7373export async function getStaticProps() {
7474 const posts = getAllPosts(
7575 ["title", "slug", "date", "description", "extra"],
76− "updates"
76+ "updates",
77+ "date"
7778 );
7879
7980 return {
pages/updates/[slug].js+1−1
@@ -124,7 +124,7 @@ export async function getStaticProps({ params }) {
124124}
125125
126126export async function getStaticPaths() {
127− const posts = getAllPosts(["slug", "date"], "updates");
127+ const posts = getAllPosts(["slug", "date"], "updates", "date");
128128
129129 return {
130130 paths: posts.map((post) => {