import Layout from '../../components/layout'; import { getAllNotes, getNote } from '../../util/slug'; import ReactMarkdown from 'react-markdown'; import SyntaxHighlighter from 'react-syntax-highlighter'; import { monokaiSublime } from 'react-syntax-highlighter/dist/cjs/styles/hljs'; import remarkGfm from 'remark-gfm'; function Note({ note }: any) { return (<>
{String(children).replace(/\n$/, '')} ) : {children} } }} >{note.content}
); } export async function getStaticProps({ params }: any) { const note = getNote(params.page); return { props: { note } }; } export async function getStaticPaths() { const notes = getAllNotes(); return { paths: notes.map((note: any) => { return { params: { page: note.slug } } }), fallback: false }; } export default Note;