From 791af3a1af3f56c597b777aa8952c0ba84a22776 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 29 Sep 2021 14:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=95=B6=20=E4=BF=AE=E5=A4=8D=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/CommonHead.js | 45 ++++++++++++++++++++++++++++++++++++++++ layouts/ArticleLayout.js | 23 ++------------------ layouts/DefaultLayout.js | 7 +++++++ pages/_document.js | 14 +------------ 4 files changed, 55 insertions(+), 34 deletions(-) create mode 100644 components/CommonHead.js diff --git a/components/CommonHead.js b/components/CommonHead.js new file mode 100644 index 00000000..cb07bb7f --- /dev/null +++ b/components/CommonHead.js @@ -0,0 +1,45 @@ +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 4df0d085..ba7d12ea 100644 --- a/layouts/ArticleLayout.js +++ b/layouts/ArticleLayout.js @@ -14,7 +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' +import CommonHead from '@/components/CommonHead' const mapPageUrl = id => { return 'https://www.notion.so/' + id.replace(/-/g, '') @@ -40,26 +40,7 @@ const ArticleLayout = ({ return (
- - {meta.title} - - - - - - {meta.type === 'article' && ( - <> - - - - )} - + {/* live2d 看板娘 */}