import Layout from "../components/Layout"; import fs from "fs"; import path from "path"; import matter from "gray-matter"; import Card from "../components/Card"; import { motion } from "framer-motion"; import { gardenFilePath, GARDENS_PATH } from "../utils/mdxUtils"; export default function Directory({ gardens }) { return ( {gardens.map((garden) => ( ))} ); } export function getStaticProps() { const gardens = gardenFilePath.map((filePath) => { const source = fs.readFileSync(path.join(GARDENS_PATH, filePath)); const { content, data } = matter(source); return { content, data, filePath, }; }); return { props: { gardens } }; }