feat: add front-matter variable category
This commit is contained in:
1 parent
2b000f7e55
commit
b171ad463e
10 files changed
+22
-8
No files matched your search
@@ -60,6 +60,9 @@ export async function getCategoryMap(): Promise<CategoryMap> {
|
||||
let root: CategoryMap = {};
|
||||
allBlogPosts.map((post) => {
|
||||
let current = root;
|
||||
if (post.data.category) {
|
||||
post.data.categories = [post.data.category];
|
||||
}
|
||||
if (!post.data.categories)
|
||||
return;
|
||||
for (const c of post.data.categories) {
|
||||
|
||||
Reference in new issue
Block a user