-
-
Save brunosabot/d1415002ea8e916cee28ca5c11ef8803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from "fs"; | |
import path from "path"; | |
const POSTS_PATH = path.join(process.cwd(), "posts"); | |
const posts = fs | |
.readdirSync(POSTS_PATH) | |
.filter((path) => /\.mdx?$/.test(path)) | |
.map((path) => fs.readFileSync(POSTS_PATH + "/" + path)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment