Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 增加 algolia 的配置 #3082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions versions/3.8/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from 'vitepress'
import { defineConfig, mergeConfig } from 'vitepress'
import { shared } from '../../../../@config/shared'

// 每个语言的配置
Expand All @@ -10,7 +10,7 @@ import { nav } from '../../../../@config/shared';
import menusEN from '../../en/summary.json' with {type: 'json'};
import menusZH from '../../zh/summary.json' with {type: 'json'};

import { version } from './version.ts';
import { version, algoliaAppid, algoliaSearchKey, algoliaIndexName } from './version.ts';

// 英文配置
const configEn = configEnFn(version);
Expand Down Expand Up @@ -46,7 +46,7 @@ const zh = defineConfig({
}
})

export default defineConfig({
export default mergeConfig(defineConfig({
...shared,
base: `/creator/${version}/manual/` , // `/${version}/`
locales: {
Expand All @@ -55,4 +55,15 @@ export default defineConfig({
en: { label: 'English', ...en },
zh: { label: '简体中文', ...zh }
}
})
}), defineConfig({
themeConfig: {
search: {
provider: 'algolia',
options: {
appId: algoliaAppid,
apiKey: algoliaSearchKey,
indexName: algoliaIndexName,
}
}
}
}))
7 changes: 6 additions & 1 deletion versions/3.8/.vitepress/config/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export const version = '3.8';
export const version = '3.8';

// 每个版本 都有独立的 algolia 的配置
export const algoliaAppid = 'EW77GMOM1P';
export const algoliaSearchKey = '6e07ac11d829e8b52bec0ab0ca3da693';
export const algoliaIndexName = 'cocos'