Skip to content

Commit

Permalink
Merge pull request #19 from calimania/feat/pages
Browse files Browse the repository at this point in the history
Only displaying Active pages in /pages
  • Loading branch information
dvidsilva authored Dec 24, 2024
2 parents 77a50e1 + 7a92e48 commit b40eb6d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/pages/pages.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ const store = stores.find(
);
let pages = await getCollection("pages");
pages = pages.sort(
(a, b) =>
new Date(b.data.createdAt).getTime() - new Date(a.data.createdAt).getTime()
);
pages = pages
.sort(
(a, b) =>
new Date(b.data.createdAt).getTime() -
new Date(a.data.createdAt).getTime()
)
.filter(
page => page.data.Active && !["about", "home"].includes(page.data.slug)
);
---

<Layout title={`Pages Index | ${SITE.title}`}>
Expand Down

0 comments on commit b40eb6d

Please sign in to comment.