全文索引微调

This commit is contained in:
tangly1024
2022-04-13 14:25:15 +08:00
parent 52e707ced3
commit a00241040d

View File

@@ -2,14 +2,14 @@ import { getGlobalNotionData } from '@/lib/notion/getNotionData'
import { useGlobal } from '@/lib/global'
import { getDataFromCache } from '@/lib/cache/cache_manager'
import * as ThemeMap from '@/themes'
import BLOG from '@/blog.config'
const Index = props => {
const { keyword, siteInfo } = props
const { locale } = useGlobal()
const meta = {
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteInfo.title
}`,
description: siteInfo.title,
title: `${keyword || ''}${keyword ? ' | ' : ''}${locale.NAV.SEARCH} | ${siteInfo?.title}`,
description: siteInfo?.title,
slug: 'search/' + (keyword || ''),
type: 'website'
}
@@ -29,7 +29,7 @@ const Index = props => {
* @param {*} param0
* @returns
*/
export async function getServerSideProps({ params: { keyword } }) {
export async function getStaticProps({ params: { keyword } }) {
const props = await getGlobalNotionData({
from: 'search-props',
pageType: ['Post']
@@ -41,6 +41,13 @@ export async function getServerSideProps({ params: { keyword } }) {
}
}
export async function getStaticPaths() {
return {
paths: [{ params: { keyword: BLOG.TITLE } }],
fallback: true
}
}
/**
* 将对象的指定字段拼接到字符串
* @param sourceTextArray