[upgrade] Abstract components on the page into subcomponents

This commit is contained in:
PrinOrange
2024-09-28 00:18:55 +08:00
parent f00a79fcf3
commit 959e513dcd
31 changed files with 508 additions and 374 deletions

View File

@@ -1,8 +1,7 @@
import fs from "fs";
import path from "path";
import { PostFilesDirectory } from "@/consts/consts";
import type { TPostFrontmatter } from "@/types/frontmatter.type";
import type { TPostListItem, TPostsByTag } from "@/types/docs.type";
import type { TPostFrontmatter, TPostListItem, TPostsByTag } from "@/types/docs.type";
import { serialize } from "next-mdx-remote/serialize";
import { titleCase } from "title-case";
import { isEmptyString, nullifyEmptyArray, nullifyEmptyString } from "./utils";
@@ -93,7 +92,7 @@ const sortOutPosts = async (): Promise<{
});
allPostList.forEach((item) => {
item.frontMatter.tags?.forEach((tagName) => {
item.frontMatter.tags?.forEach((tagName: string) => {
if (postsByTag[tagName] == null) {
postsByTag[tagName] = [];
}