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 看板娘 */}