mirror of https://github.com/garritfra/garrit.xyz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
444 B
13 lines
444 B
export const parseTags = (strings) => { |
|
const postTags = keys |
|
.map((key, index) => { |
|
const value = values[index]; |
|
// Parse yaml metadata & markdownbody in document |
|
|
|
const document = matter(value.default); |
|
const rawTags = document.data?.tags || ""; |
|
return rawTags.split(",").map((tag) => tag.trim()); |
|
}) |
|
.flat() |
|
.filter((value) => value !== ""); |
|
};
|
|
|