From a4d051fa38b28268f173bf54a33a3cc768dc6928 Mon Sep 17 00:00:00 2001 From: tangly Date: Sat, 6 Nov 2021 12:15:46 +0800 Subject: [PATCH] =?UTF-8?q?feature=EF=BC=9A=20=E6=96=87=E7=AB=A0=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E5=85=B3=E9=94=AE=E8=AF=8DSEO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 2 +- components/CommonHead.js | 8 +++++--- pages/article/[slug].js | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/blog.config.js b/blog.config.js index 90167ec0..a82b36fd 100644 --- a/blog.config.js +++ b/blog.config.js @@ -20,7 +20,7 @@ const BLOG = { autoCollapsedNavBar: false, // the automatically collapsed navigation bar socialLink: 'https://weibo.com/u/2245301913', seo: { - keywords: ['建站', '自媒体', 'Notion', '赚钱', '写作', '副业'], + keywords: ['建站', 'Notion', '赚钱', '写作', '副业'], googleSiteVerification: '' // Remove the value or replace it with your own google site verification code }, analytics: { diff --git a/components/CommonHead.js b/components/CommonHead.js index a805d0b3..eb18780b 100644 --- a/components/CommonHead.js +++ b/components/CommonHead.js @@ -9,9 +9,11 @@ const CommonHead = ({ meta }) => { const title = meta?.title || BLOG.title const description = meta?.description || BLOG.description const type = meta?.type || 'website' + const keywords = meta?.tags || BLOG.seo.keywords + return {title} - + @@ -21,8 +23,8 @@ const CommonHead = ({ meta }) => { content={BLOG.seo.googleSiteVerification} /> )} - {BLOG.seo.keywords && ( - + {keywords && ( + )} diff --git a/pages/article/[slug].js b/pages/article/[slug].js index de823e11..3104e41a 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -35,7 +35,8 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, posts, categories }) const meta = { title: `${post.title} | ${BLOG.title}`, description: post.summary, - type: 'article' + type: 'article', + tags: post.tags } const targetRef = useRef(null) const drawerRight = useRef(null)