Update posts by tag, fix ul styling
This commit is contained in:
1 parent
a9097ab84f
commit
77d762b196
8 files changed
+59
-36
No files matched your search
@@ -0,0 +1,23 @@
|
||||
export default function getTags(posts) {
|
||||
// Get tags from all posts
|
||||
const allTags = posts
|
||||
.map((post) => {
|
||||
const postTags = post.frontmatter.tags;
|
||||
let allTags = [];
|
||||
|
||||
if (postTags.length > 0) {
|
||||
postTags.forEach((tag) => {
|
||||
if (allTags.indexOf(tag) === -1) {
|
||||
allTags.push(tag);
|
||||
}
|
||||
});
|
||||
}
|
||||
return allTags;
|
||||
})
|
||||
.flat(1);
|
||||
|
||||
// Make the tags unique
|
||||
let tags = [...new Set(allTags)];
|
||||
|
||||
return tags;
|
||||
}
|
||||
Reference in new issue
Block a user