feat: add archive view of posts
This commit is contained in:
parent
5e72b839fe
commit
6265474981
8 changed files with 78 additions and 10 deletions
|
@ -32,9 +32,9 @@ const getPostsByCategory = (collection) => {
|
|||
|
||||
const postsByCategory = {};
|
||||
categories.forEach((category) => {
|
||||
const categoryPosts = posts.filter((post) =>
|
||||
post.data.categories.includes(category),
|
||||
);
|
||||
const categoryPosts = posts.filter((post) => {
|
||||
return post.data.categories.includes(category);
|
||||
});
|
||||
|
||||
postsByCategory[category] = categoryPosts;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue