mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-09 07:26:47 +00:00
feature:
文章标题SEO
This commit is contained in:
@@ -25,7 +25,7 @@ const About = ({ post, blockMap, tags, prev, next, allPosts, categories }) => {
|
|||||||
}
|
}
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${locale.NAV.ABOUT}`,
|
title: `${locale.NAV.ABOUT} | ${BLOG.title} `,
|
||||||
description: post.summary,
|
description: post.summary,
|
||||||
type: 'post',
|
type: 'post',
|
||||||
tags: []
|
tags: []
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const Index = ({ allPosts, tags, categories }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${locale.NAV.ARCHIVE} `,
|
title: `${locale.NAV.ARCHIVE} | ${BLOG.title}`,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const Slug = ({ post, blockMap, tags, prev, next, allPosts, recommendPosts, cate
|
|||||||
return <Custom404 />
|
return <Custom404 />
|
||||||
}
|
}
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${post.title}`,
|
title: `${post.title} | ${BLOG.title}`,
|
||||||
description: post.summary,
|
description: post.summary,
|
||||||
type: 'article',
|
type: 'article',
|
||||||
tags: post.tags
|
tags: post.tags
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import BlogPostListScroll from '@/components/BlogPostListScroll'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import CategoryList from '@/components/CategoryList'
|
import CategoryList from '@/components/CategoryList'
|
||||||
import { getNotionPageData } from '@/lib/notion/getNotionData'
|
import { getNotionPageData } from '@/lib/notion/getNotionData'
|
||||||
|
import { useGlobal } from '@/lib/global'
|
||||||
|
|
||||||
export default function Category ({ tags, allPosts, filteredPosts, category, categories }) {
|
export default function Category ({ tags, allPosts, filteredPosts, category, categories }) {
|
||||||
|
const { locale } = useGlobal()
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${category}`,
|
title: `${category} | ${locale.COMMON.CATEGORY} | ${BLOG.title}`,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { faFolder, faThList } from '@fortawesome/free-solid-svg-icons'
|
|||||||
export default function Category ({ tags, allPosts, categories }) {
|
export default function Category ({ tags, allPosts, categories }) {
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${locale.COMMON.CATEGORY}`,
|
title: `${locale.COMMON.CATEGORY} | ${BLOG.title}`,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export async function getStaticProps () {
|
|||||||
const tagOptions = notionPageData.tagOptions
|
const tagOptions = notionPageData.tagOptions
|
||||||
const tags = await getAllTags({ allPosts, tagOptions })
|
const tags = await getAllTags({ allPosts, tagOptions })
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${BLOG.description} `,
|
title: `${BLOG.title}`,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const Search = ({ allPosts, tags, categories }) => {
|
|||||||
}
|
}
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${locale.NAV.SEARCH} `,
|
title: `${locale.NAV.SEARCH} ${searchKey}| ${BLOG.title} `,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import BaseLayout from '@/layouts/BaseLayout'
|
|||||||
import BlogPostListScroll from '@/components/BlogPostListScroll'
|
import BlogPostListScroll from '@/components/BlogPostListScroll'
|
||||||
import TagList from '@/components/TagList'
|
import TagList from '@/components/TagList'
|
||||||
import { getNotionPageData } from '@/lib/notion/getNotionData'
|
import { getNotionPageData } from '@/lib/notion/getNotionData'
|
||||||
|
import { useGlobal } from '@/lib/global'
|
||||||
|
|
||||||
export default function Tag ({ tags, allPosts, filteredPosts, tag, categories }) {
|
export default function Tag ({ tags, allPosts, filteredPosts, tag, categories }) {
|
||||||
|
const { locale } = useGlobal()
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | #${tag}`,
|
title: `${tag} | ${locale.COMMON.TAGS} | ${BLOG.title}`,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { faTags } from '@fortawesome/free-solid-svg-icons'
|
|||||||
export default function Tag ({ tags, allPosts, categories }) {
|
export default function Tag ({ tags, allPosts, categories }) {
|
||||||
const { locale } = useGlobal()
|
const { locale } = useGlobal()
|
||||||
const meta = {
|
const meta = {
|
||||||
title: `${BLOG.title} | ${locale.COMMON.TAGS}`,
|
title: `${locale.COMMON.TAGS} | ${BLOG.title}`,
|
||||||
description: BLOG.description,
|
description: BLOG.description,
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user