文章标题SEO
This commit is contained in:
tangly1024
2021-12-24 16:35:53 +08:00
parent aa562b3403
commit 0756dedb5a
9 changed files with 14 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ const About = ({ post, blockMap, tags, prev, next, allPosts, categories }) => {
}
const { locale } = useGlobal()
const meta = {
title: `${BLOG.title} | ${locale.NAV.ABOUT}`,
title: `${locale.NAV.ABOUT} | ${BLOG.title} `,
description: post.summary,
type: 'post',
tags: []

View File

@@ -36,7 +36,7 @@ const Index = ({ allPosts, tags, categories }) => {
})
const meta = {
title: `${BLOG.title} | ${locale.NAV.ARCHIVE} `,
title: `${locale.NAV.ARCHIVE} | ${BLOG.title}`,
description: BLOG.description,
type: 'website'
}

View File

@@ -18,7 +18,7 @@ const Slug = ({ post, blockMap, tags, prev, next, allPosts, recommendPosts, cate
return <Custom404 />
}
const meta = {
title: `${BLOG.title} | ${post.title}`,
title: `${post.title} | ${BLOG.title}`,
description: post.summary,
type: 'article',
tags: post.tags

View File

@@ -6,10 +6,12 @@ import BlogPostListScroll from '@/components/BlogPostListScroll'
import React from 'react'
import CategoryList from '@/components/CategoryList'
import { getNotionPageData } from '@/lib/notion/getNotionData'
import { useGlobal } from '@/lib/global'
export default function Category ({ tags, allPosts, filteredPosts, category, categories }) {
const { locale } = useGlobal()
const meta = {
title: `${BLOG.title} | ${category}`,
title: `${category} | ${locale.COMMON.CATEGORY} | ${BLOG.title}`,
description: BLOG.description,
type: 'website'
}

View File

@@ -11,7 +11,7 @@ import { faFolder, faThList } from '@fortawesome/free-solid-svg-icons'
export default function Category ({ tags, allPosts, categories }) {
const { locale } = useGlobal()
const meta = {
title: `${BLOG.title} | ${locale.COMMON.CATEGORY}`,
title: `${locale.COMMON.CATEGORY} | ${BLOG.title}`,
description: BLOG.description,
type: 'website'
}

View File

@@ -13,7 +13,7 @@ export async function getStaticProps () {
const tagOptions = notionPageData.tagOptions
const tags = await getAllTags({ allPosts, tagOptions })
const meta = {
title: `${BLOG.title} | ${BLOG.description} `,
title: `${BLOG.title}`,
description: BLOG.description,
type: 'website'
}

View File

@@ -40,7 +40,7 @@ const Search = ({ allPosts, tags, categories }) => {
}
const { locale } = useGlobal()
const meta = {
title: `${BLOG.title} | ${locale.NAV.SEARCH} `,
title: `${locale.NAV.SEARCH} ${searchKey}| ${BLOG.title} `,
description: BLOG.description,
type: 'website'
}

View File

@@ -5,10 +5,13 @@ import BaseLayout from '@/layouts/BaseLayout'
import BlogPostListScroll from '@/components/BlogPostListScroll'
import TagList from '@/components/TagList'
import { getNotionPageData } from '@/lib/notion/getNotionData'
import { useGlobal } from '@/lib/global'
export default function Tag ({ tags, allPosts, filteredPosts, tag, categories }) {
const { locale } = useGlobal()
const meta = {
title: `${BLOG.title} | #${tag}`,
title: `${tag} | ${locale.COMMON.TAGS} | ${BLOG.title}`,
description: BLOG.description,
type: 'website'
}

View File

@@ -11,7 +11,7 @@ import { faTags } from '@fortawesome/free-solid-svg-icons'
export default function Tag ({ tags, allPosts, categories }) {
const { locale } = useGlobal()
const meta = {
title: `${BLOG.title} | ${locale.COMMON.TAGS}`,
title: `${locale.COMMON.TAGS} | ${BLOG.title}`,
description: BLOG.description,
type: 'website'
}