Skip to content

Commit

Permalink
Add category of featured posts
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallku committed Jan 21, 2025
1 parent 3ef3114 commit 37db400
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/blog/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ const cx = classNames(styles, "home");

export default async function Home() {
const posts = getPosts();
const mostRecentPost = posts[0];
const categories = getCategories();
const postsInPage = posts
.slice(1)
.filter(({ category }) => !!categories.find(({ slug }) => slug === category))
.slice(0, PAGE_SIZE);
const devPosts = posts.filter(({ category }) => category === "/dev");
const mostRecentPost = devPosts[0];
const postsInPage = devPosts.slice(1).slice(0, PAGE_SIZE);
const galleryPosts = posts.filter(({ category }) => category === "/gallery").slice(0, 6);

return (
Expand Down

0 comments on commit 37db400

Please sign in to comment.