Add base setup
This commit is contained in:
11
utils/mdxUtils.ts
Normal file
11
utils/mdxUtils.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
// POSTS_PATH is useful when you want to get the path to a specific file
|
||||
export const POSTS_PATH = path.join(process.cwd(), "posts");
|
||||
|
||||
// postFilePaths is the list of all mdx files inside the POSTS_PATH directory
|
||||
export const postFilePaths = fs
|
||||
.readdirSync(POSTS_PATH)
|
||||
// Only include md(x) files
|
||||
.filter((path) => /\.mdx?$/.test(path));
|
Reference in New Issue
Block a user