fix release version 1.11.0

This commit is contained in:
Wildan Nursahidan
2025-05-25 03:20:17 +07:00
parent 209a80d5e8
commit 73a9843d4e
53 changed files with 1985 additions and 3334 deletions

View File

@@ -25,6 +25,7 @@ import Button from "@/components/markdown/ButtonMdx";
import Accordion from "@/components/markdown/AccordionMdx";
import CardGroup from "@/components/markdown/CardGroupMdx";
import Kbd from "@/components/markdown/KeyboardMdx";
import { Release, Changes } from "@/components/markdown/ReleaseMdx";
// add custom components
const components = {
@@ -46,6 +47,8 @@ const components = {
Accordion,
CardGroup,
Kbd,
Release,
Changes,
};
// can be used for other pages like blogs, Guides etc
@@ -179,13 +182,15 @@ const postProcess = () => (tree: any) => {
});
};
export type Author = {
avatar?: string;
handle: string;
username: string;
handleUrl: string;
};
// export type Author = {
// avatar?: string;
// handle: string;
// username: string;
// handleUrl: string;
// };
// Blog related types and functions have been removed
/*
export type BlogMdxFrontmatter = BaseMdxFrontmatter & {
date: string;
authors: Author[];
@@ -199,20 +204,26 @@ export async function getAllBlogStaticPaths() {
return res.map((file) => file.split(".")[0]);
} catch (err) {
console.log(err);
return [];
}
}
export async function getAllBlogs() {
const blogFolder = path.join(process.cwd(), "/contents/blogs/");
const files = await fs.readdir(blogFolder);
const uncheckedRes = await Promise.all(
files.map(async (file) => {
if (!file.endsWith(".mdx")) return undefined;
const filepath = path.join(process.cwd(), `/contents/blogs/${file}`);
const rawMdx = await fs.readFile(filepath, "utf-8");
return {
...justGetFrontmatterFromMD<BlogMdxFrontmatter>(rawMdx),
slug: file.split(".")[0],
};
try {
const filepath = path.join(process.cwd(), `/contents/blogs/${file}`);
const rawMdx = await fs.readFile(filepath, "utf-8");
return {
...justGetFrontmatterFromMD<BlogMdxFrontmatter>(rawMdx),
slug: file.split(".")[0],
};
} catch (err) {
console.log(err);
return null;
}
})
);
return uncheckedRes.filter((it) => !!it) as (BlogMdxFrontmatter & {
@@ -221,11 +232,13 @@ export async function getAllBlogs() {
}
export async function getBlogForSlug(slug: string) {
const blogFile = path.join(process.cwd(), "/contents/blogs/", `${slug}.mdx`);
try {
const blogFile = path.join(process.cwd(), "/contents/blogs/", `${slug}.mdx`);
const rawMdx = await fs.readFile(blogFile, "utf-8");
return await parseMdx<BlogMdxFrontmatter>(rawMdx);
} catch {
return undefined;
} catch (err) {
console.log(err);
return null;
}
}
*/

9
lib/toc.ts Normal file
View File

@@ -0,0 +1,9 @@
export interface TocItem {
level: number;
text: string;
href: string;
}
export interface MobTocProps {
tocs: TocItem[];
}