diff --git a/components/notes/Comments.tsx b/components/notes/Comments.tsx index 3f10f9ec..8500c433 100644 --- a/components/notes/Comments.tsx +++ b/components/notes/Comments.tsx @@ -1,5 +1,4 @@ import { useRef, useEffect, useState } from "react"; -import Head from "next/head"; import { useTheme } from "next-themes"; import { githubRepo } from "../../lib/config"; @@ -40,21 +39,11 @@ const Comments = (props: Props) => { }, [resolvedTheme]); // eslint-disable-line react-hooks/exhaustive-deps return ( - <> -
- - - - - - - > + ); }; diff --git a/pages/notes/[slug].tsx b/pages/notes/[slug].tsx index 13bab1c7..3914e755 100644 --- a/pages/notes/[slug].tsx +++ b/pages/notes/[slug].tsx @@ -1,5 +1,6 @@ import { useMemo } from "react"; import dynamic from "next/dynamic"; +import Head from "next/head"; import { NextSeo, ArticleJsonLd } from "next-seo"; import { escape } from "html-escaper"; import { getMDXComponent } from "mdx-bundler/client"; @@ -17,6 +18,15 @@ const Note = ({ frontMatter, mdxSource }) => { return ( <> + {/* preload here instead of Comments.tsx -- by the time it's loaded dynamically, there's no real point anymore */} + {frontMatter.noComments !== true && ( + + + + + + )} +