import fs from 'fs' import matter from 'gray-matter' import Link from 'next/link' import path from 'path' import Layout from '../components/Layout' import { postFilePaths, POSTS_PATH } from '../utils/mdxUtils' export default function Index({ posts }) { return (

Home Page

Click the link below to navigate to a page generated by{' '} next-mdx-remote.

) } export function getStaticProps() { const posts = postFilePaths.map((filePath) => { const source = fs.readFileSync(path.join(POSTS_PATH, filePath)) const { content, data } = matter(source) return { content, data, filePath, } }) return { props: { posts } } }