feat: move books to their own section
This commit is contained in:
parent
8c72d1dd56
commit
db87e0928f
37 changed files with 134 additions and 39 deletions
|
@ -15,24 +15,6 @@ export const postsByTag = (collection) => {
|
|||
return postsByTag;
|
||||
};
|
||||
|
||||
export const gamesByYear = (collection) => {
|
||||
const allGames = collection.getFilteredByTag("game");
|
||||
const gamesByYear = {};
|
||||
|
||||
allGames.forEach((game) => {
|
||||
const date = new dayjs(game.date);
|
||||
const year = date.year();
|
||||
|
||||
if (!gamesByYear[year]) {
|
||||
gamesByYear[year] = { value: year, data: [game] };
|
||||
} else {
|
||||
gamesByYear[year].data.push(game);
|
||||
}
|
||||
});
|
||||
|
||||
return gamesByYear;
|
||||
};
|
||||
|
||||
export const catalogueByType = (collection) => {
|
||||
const allItems = collection.getFilteredByTag("catalogue");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue