This commit is contained in:
Mrrp 2025-01-04 12:20:53 -08:00
parent 6c2bae94d8
commit 2d78426857
11 changed files with 159 additions and 101 deletions

View file

@ -54,10 +54,24 @@ function generatePageCategory(pagesInfo: Record<string, any>): PageCategory {
const postDirectories: pages.PageLocation[] = [
{
title: "Blog",
description: "A collection of blog posts",
description: "General blog posts",
tags: ["blog"],
map: "blog",
root: "content/blog"
},
{
title: "Site",
description: "Articles to test site functionality",
tags: ["site"],
map: "site",
root: "content/site"
},
{
title: "Collections",
description: "Articles that are collections of information: Lists, Awesome lists, etc.",
tags: ["collection"],
map: "collections",
root: "content/collections"
}
]
@ -69,6 +83,9 @@ var postList: PageList = {
for (const postDirectory of postDirectories) {
const pagesInfo = pages.getPagesInfo("", postDirectory);
postList.categories[postDirectory.title] = generatePageCategory(pagesInfo);
postList.categories[postDirectory.title].title = postDirectory.title;
postList.categories[postDirectory.title].description = postDirectory.description;
postList.categories[postDirectory.title].tags = postDirectory.tags;
}
// Sort the posts by date
@ -87,4 +104,4 @@ for (const category of Object.values(postList.categories)) {
console.log(JSON.stringify(postList, null, 2));
// Output to assets/blog_list.json (overwriting)
fs.writeFileSync("assets/meta/blog_list.json", JSON.stringify(postList, null, 2));
fs.writeFileSync("assets/meta/post_list.json", JSON.stringify(postList, null, 2));