feature:

文章详情页关键词SEO
This commit is contained in:
tangly
2021-11-06 12:15:46 +08:00
parent 46495f9fe6
commit a4d051fa38
3 changed files with 8 additions and 5 deletions

View File

@@ -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: {

View File

@@ -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 <Head>
<title>{title}</title>
<meta content={BLOG.darkBackground} name='theme-color' />
<meta name='theme-color' content={BLOG.darkBackground} />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<meta name='robots' content='follow, index' />
<meta charSet='UTF-8' />
@@ -21,8 +23,8 @@ const CommonHead = ({ meta }) => {
content={BLOG.seo.googleSiteVerification}
/>
)}
{BLOG.seo.keywords && (
<meta name='keywords' content={BLOG.seo.keywords.join(', ')} />
{keywords && (
<meta name='keywords' content={keywords.join(', ')} />
)}
<meta name='description' content={description} />
<meta property='og:locale' content={BLOG.lang} />

View File

@@ -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)