feat: move books to their own section

This commit is contained in:
Devin Haska 2024-11-17 19:14:16 -08:00
parent 8c72d1dd56
commit db87e0928f
37 changed files with 134 additions and 39 deletions

View file

@ -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");