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,
|
||||
};
|
||||
|
|
|
@ -4,7 +4,6 @@ const advancedFormat = require("dayjs/plugin/advancedFormat");
|
|||
|
||||
const postcss = require("postcss");
|
||||
const cssnano = require("cssnano");
|
||||
const { default: slugify } = require("slugify");
|
||||
|
||||
const keys = Object.keys;
|
||||
const values = Object.values;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue