From be3b50c788391a802b7da113bd4be17b2528bd90 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 29 Sep 2021 14:03:14 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=95=B6=20=E5=B0=9D=E8=AF=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=A6=96=E9=A1=B5=E6=89=93=E5=BC=80=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/CommonHead.js | 45 ---------------------------------------- layouts/ArticleLayout.js | 25 ++++++++++++++++++++-- layouts/DefaultLayout.js | 21 +++++++------------ pages/_document.js | 14 +++++++++++++ 4 files changed, 44 insertions(+), 61 deletions(-) delete mode 100644 components/CommonHead.js diff --git a/components/CommonHead.js b/components/CommonHead.js deleted file mode 100644 index cb07bb7f..00000000 --- a/components/CommonHead.js +++ /dev/null @@ -1,45 +0,0 @@ -import BLOG from '@/blog.config' -import Head from 'next/head' - -const CommonHead = ({ meta }) => { - const url = BLOG.path.length ? `${BLOG.link}/${BLOG.path}` : BLOG.link - - return - {meta.title} - - - - {BLOG.seo.googleSiteVerification && ( - - )} - {BLOG.seo.keywords && ( - - )} - - - - - - - - - - {meta.type === 'article' && ( - <> - - - - )} - -} - -export default CommonHead diff --git a/layouts/ArticleLayout.js b/layouts/ArticleLayout.js index 997badaa..4df0d085 100644 --- a/layouts/ArticleLayout.js +++ b/layouts/ArticleLayout.js @@ -4,7 +4,6 @@ import BLOG from '@/blog.config' import formatDate from '@/lib/formatDate' import 'gitalk/dist/gitalk.css' import Comment from '@/components/Comment' -import CommonHead from '@/components/CommonHead' import Progress from '@/components/Progress' import { useRef } from 'react' import Image from 'next/image' @@ -15,6 +14,7 @@ import BlogPostMini from '@/components/BlogPostMini' import { useRouter } from 'next/router' import ShareButton from '@/components/ShareButton' import TopJumper from '@/components/TopJumper' +import { Head } from 'next/document' const mapPageUrl = id => { return 'https://www.notion.so/' + id.replace(/-/g, '') @@ -37,9 +37,30 @@ const ArticleLayout = ({ const targetRef = useRef(null) const { theme } = useTheme() const url = BLOG.link + useRouter().asPath + return (
- + + {meta.title} + + + + + + {meta.type === 'article' && ( + <> + + + + )} + + {/* live2d 看板娘 */}