mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 07:26:47 +00:00
feature:
封装useGlobal组件,存放全局变量; 新增search页面,修复搜索页无法分页的bug
This commit is contained in:
@@ -2,10 +2,15 @@ import BLOG from '@/blog.config'
|
||||
import Head from 'next/head'
|
||||
|
||||
const CommonHead = ({ meta }) => {
|
||||
const url = BLOG.path.length ? `${BLOG.link}/${BLOG.path}` : BLOG.link
|
||||
|
||||
let url = BLOG.path.length ? `${BLOG.link}/${BLOG.path}` : BLOG.link
|
||||
if (meta) {
|
||||
url = `${url}/${meta.slug}`
|
||||
}
|
||||
const title = meta?.title || BLOG.title
|
||||
const description = meta?.description || BLOG.description
|
||||
const type = meta?.type || 'website'
|
||||
return <Head>
|
||||
<title>{meta.title}</title>
|
||||
<title>{title}</title>
|
||||
<meta content={BLOG.darkBackground} name='theme-color' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
||||
<meta name='robots' content='follow, index' />
|
||||
@@ -19,18 +24,16 @@ const CommonHead = ({ meta }) => {
|
||||
{BLOG.seo.keywords && (
|
||||
<meta name='keywords' content={BLOG.seo.keywords.join(', ')} />
|
||||
)}
|
||||
<meta name='description' content={meta.description} />
|
||||
<meta name='description' content={description} />
|
||||
<meta property='og:locale' content={BLOG.lang} />
|
||||
<meta property='og:title' content={meta.title} />
|
||||
<meta property='og:description' content={meta.description} />
|
||||
<meta
|
||||
property='og:url'
|
||||
content={meta.slug ? `${url}/${meta.slug}` : url}
|
||||
<meta property='og:title' content={title} />
|
||||
<meta property='og:description' content={description} />
|
||||
<meta property='og:url' content={url}
|
||||
/>
|
||||
<meta property='og:type' content={meta.type} />
|
||||
<meta property='og:type' content={type} />
|
||||
<meta name='twitter:card' content='summary_large_image' />
|
||||
<meta name='twitter:description' content={meta.description} />
|
||||
<meta name='twitter:title' content={meta.title} />
|
||||
<meta name='twitter:description' content={description} />
|
||||
<meta name='twitter:title' content={title} />
|
||||
{meta.type === 'article' && (
|
||||
<>
|
||||
<meta
|
||||
|
||||
Reference in New Issue
Block a user