digital-gardeners/utils/mdxUtils.js
2021-09-06 15:42:22 +01:00

13 lines
468 B
JavaScript

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 GARDENS_PATH = path.join(process.cwd(), "gardens");
export const TOOLS_PATH = path.join(process.cwd(), "tools");
// patternFilePath is the list of all mdx files inside the POSTS_PATH directory
export const gardenFilePath = fs
.readdirSync(GARDENS_PATH)
// Only include md(x) files
.filter((path) => /\.mdx?$/.test(path));