mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-13 07:42:52 +01:00
feat: add front-matter variable category
This commit is contained in:
@@ -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