import { InView } from "react-intersection-observer"; import { NextSeo, ArticleJsonLd } from "next-seo"; import { MDXRemote } from "next-mdx-remote"; import { htmlEscape } from "escape-goat"; import Content from "../../components/Content/Content"; import NoteMeta from "../../components/NoteMeta/NoteMeta"; import NoteTitle from "../../components/NoteTitle/NoteTitle"; import Comments from "../../components/Comments/Comments"; import * as mdxComponents from "../../lib/mdx-components"; import { getNote, getNoteSlugs } from "../../lib/parse-notes"; import * as config from "../../lib/config"; import type { GetStaticProps, GetStaticPaths } from "next"; import type { NoteType } from "../../types"; const Note = ({ frontMatter, source }: NoteType) => { return ( <> {/* @ts-ignore */} {frontMatter.noComments !== true && ( {({ inView, ref }) => (
{inView && }
)}
)} ); }; export const getStaticProps: GetStaticProps = async ({ params }) => { const { frontMatter, source } = await getNote(params.slug as string); return { props: { frontMatter, source, }, }; }; export const getStaticPaths: GetStaticPaths = async () => { const paths = getNoteSlugs().map((slug) => ({ params: { slug } })); return { paths, fallback: false, }; }; export default Note;