1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-16 19:45:33 -04:00

clean up ThemeContext

This commit is contained in:
2022-04-27 10:58:25 -04:00
parent e0d13c874d
commit c4651cb315
2 changed files with 23 additions and 27 deletions

View File

@@ -24,6 +24,7 @@ import type { NoteType } from "../../types";
export const getNoteSlugs = async () => {
// get all files in NOTES_DIR
const files = await fs.readdir(path.join(process.cwd(), NOTES_DIR));
// narrow to only the .mdx files and strip the .mdx extension
return files.filter((file) => /\.mdx$/.test(file)).map((noteFile) => noteFile.replace(/\.mdx$/, ""));
};