import type {GetStaticProps, NextPage} from 'next'; import * as fs from 'fs/promises'; import * as path from 'path'; import * as React from 'react' import {useRouter} from 'next/router'; import ReactMarkdown from 'react-markdown'; import {Layouts} from '@tesseract-design/viewfinder-react'; export interface Props { markdown: string, } const IndexPage: NextPage = ({ markdown, }) => { const router = useRouter(); const sidebarOpen = router.query.open === 'sidebar'; return ( (
    ), li: ({node, ...props}) => (
  • ), }} > {markdown} ); } export const getStaticProps: GetStaticProps = async (ctx) => { const props = {} as Record; const readmePath = path.resolve('../../README.md'); props.markdown = await fs.readFile(readmePath, 'utf-8'); return { props, }; }; export default IndexPage