Add base setup

This commit is contained in:
2022-10-12 22:16:59 +02:00
parent 7f593c65e4
commit c449ec250a
9 changed files with 118 additions and 49 deletions

View File

@@ -1,11 +1,11 @@
import fs from 'fs'
import path from 'path'
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')
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))
.filter((path) => /\.mdx?$/.test(path));