Skip to content

Commit

Permalink
don't redeclare helper fn
Browse files Browse the repository at this point in the history
  • Loading branch information
narthur committed Aug 19, 2023
1 parent ffe2032 commit f663f66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export async function getStaticPaths() {
sort: true
});
const published = (p: Post) => p.status === "publish"
return posts.map((post: Post, i: number) => {
const published = (p: Post) => p.status === "publish"
const newer = posts.slice(0, i).reverse().find(published);
const older = posts.slice(i + 1).find(published);
return {
Expand Down

0 comments on commit f663f66

Please sign in to comment.