Skip to content

Commit

Permalink
improve: use sort by publish date
Browse files Browse the repository at this point in the history
Signed-off-by: james-a-morris <[email protected]>
  • Loading branch information
james-a-morris committed Sep 17, 2024
1 parent cacb35a commit 894b02d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/app/_lib/contentful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ export async function retrieveRelevantContentfulEntries(
"fields.tag[in]": tags.join(",").toLowerCase(), // get posts with same tags
"fields.slug[nin]": entrySlugId, // don't include current post
"fields.slug[exists]": true, // no empty slugs

// TODO: Update existing posts to have publishDate
// "fields.publishDate[exists]": true, // no empty dates
// order: "-fields.publishDate", // sorted latest first
"fields.publishDate[exists]": true, // no empty dates
order: "-fields.publishDate", // sorted latest first
} as const;
const entries =
await client.withoutUnresolvableLinks.getEntries<TypeAcrossBlogPostSkeleton>(options);
Expand Down

0 comments on commit 894b02d

Please sign in to comment.