From e4d05f5104e9203770ae97be74dec901a96b2717 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Sat, 20 Apr 2024 01:47:53 -0400 Subject: [PATCH] .md file support --- Frontend/docs/{bob.mdx => bob.md} | 0 Frontend/docs/{home.mdx => home.md} | 0 Frontend/src/app/common/mdxUtils.ts | 5 ++++- 3 files changed, 4 insertions(+), 1 deletion(-) rename Frontend/docs/{bob.mdx => bob.md} (100%) rename Frontend/docs/{home.mdx => home.md} (100%) diff --git a/Frontend/docs/bob.mdx b/Frontend/docs/bob.md similarity index 100% rename from Frontend/docs/bob.mdx rename to Frontend/docs/bob.md diff --git a/Frontend/docs/home.mdx b/Frontend/docs/home.md similarity index 100% rename from Frontend/docs/home.mdx rename to Frontend/docs/home.md diff --git a/Frontend/src/app/common/mdxUtils.ts b/Frontend/src/app/common/mdxUtils.ts index 1acd631..7ffabc4 100644 --- a/Frontend/src/app/common/mdxUtils.ts +++ b/Frontend/src/app/common/mdxUtils.ts @@ -22,7 +22,10 @@ export const getDocsContent = (): DocsContentMetadata[] => export const getMetadata = (directory: string): T[] => { const files: string[] = fs .readdirSync(directory) - .filter((file: string): boolean => path.extname(file) === ".mdx"); // Read the MDX files + .filter((file: string): boolean => { + const extension: string = path.extname(file); // The file extension + return extension === ".md" || extension === ".mdx"; + }); // Read the MDX files return files.map((file: string): T => { const filePath: string = path.join(directory, file); // The path of the file return {