.md file support
All checks were successful
Deploy Frontend / docker (17, 3.8.5) (push) Successful in 33s

This commit is contained in:
Braydon 2024-04-20 01:47:53 -04:00
parent 02b1eea17b
commit e4d05f5104
3 changed files with 4 additions and 1 deletions

@ -22,7 +22,10 @@ export const getDocsContent = (): DocsContentMetadata[] =>
export const getMetadata = <T extends MDXMetadata>(directory: string): T[] => { export const getMetadata = <T extends MDXMetadata>(directory: string): T[] => {
const files: string[] = fs const files: string[] = fs
.readdirSync(directory) .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 => { return files.map((file: string): T => {
const filePath: string = path.join(directory, file); // The path of the file const filePath: string = path.join(directory, file); // The path of the file
return { return {