feat: update catalogue to work with tags
This commit is contained in:
parent
327b38f35b
commit
87deddd544
7 changed files with 48 additions and 8 deletions
|
@ -13,6 +13,23 @@ const postsByTag = (collection) => {
|
|||
return postsByTag;
|
||||
};
|
||||
|
||||
const catalogueByType = (collection) => {
|
||||
const allItems = collection.getFilteredByTag("catalogue");
|
||||
|
||||
const catalogueByType = {};
|
||||
|
||||
for (const item of allItems) {
|
||||
const type = item.data.tags[1];
|
||||
if (!type) continue;
|
||||
|
||||
catalogueByType[type] ??= [];
|
||||
catalogueByType[type].push(item);
|
||||
}
|
||||
|
||||
return catalogueByType;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
postsByTag,
|
||||
catalogueByType,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue