mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 15:10:16 +00:00
Algolia搜索
This commit is contained in:
@@ -6,6 +6,7 @@ import { generateRobotsTxt } from '@/lib/robots.txt'
|
||||
|
||||
import { useRouter } from 'next/router'
|
||||
import { getLayoutByTheme } from '@/themes/theme'
|
||||
import { generateAlgoliaSearch } from '@/lib/algolia'
|
||||
|
||||
/**
|
||||
* 首页布局
|
||||
@@ -62,6 +63,11 @@ export async function getStaticProps() {
|
||||
generateRss(props?.latestPosts || [])
|
||||
}
|
||||
|
||||
// 生成全文索引 - 仅在 yarn build 时执行 && process.env.npm_lifecycle_event === 'build'
|
||||
if (BLOG.ALGOLIA_APP_ID && JSON.parse(BLOG.ALGOLIA_RECREATE_DATA)) {
|
||||
generateAlgoliaSearch({ allPages: props.allPages })
|
||||
}
|
||||
|
||||
delete props.allPages
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user