Skip to content

Commit 15a78c0

Browse files
committed
添加 algolia搜索支持
1 parent efa994d commit 15a78c0

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

docusaurus.config.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,35 @@ const config: Config = {
148148
theme: prismThemes.github,
149149
darkTheme: prismThemes.dracula,
150150
},
151+
algolia: {
152+
// The application ID provided by Algolia
153+
appId: '8MDOTENYMF',
154+
155+
// Public API key: it is safe to commit it
156+
apiKey: '421fcded4a944281fae4f530142821fc',
157+
158+
indexName: 'www_obfuz_com_8mdotenymf_pages',
159+
160+
// Optional: see doc section below
161+
contextualSearch: true,
162+
163+
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
164+
externalUrlRegex: 'external\\.com|domain\\.com',
165+
166+
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
167+
// replaceSearchResultPathname: {
168+
// from: '/docs/', // or as RegExp: /\/docs\//
169+
// to: '/',
170+
// },
171+
172+
// Optional: Algolia search parameters
173+
searchParameters: {},
174+
175+
// Optional: path for search page that enabled by default (`false` to disable it)
176+
searchPagePath: 'search',
177+
178+
//... other Algolia params
179+
},
151180
} satisfies Preset.ThemeConfig,
152181
};
153182

0 commit comments

Comments
 (0)