Skip to content

Commit c9c4904

Browse files
ryankert01wilfred-s
authored andcommitted
[YUNIKORN-3129] Search engine is broken for docs (#535)
Algolia search fails due to some cross site security limitations in the scripting. Moving to local search to remove the dependency. * Install cmfcmf/docusaurus-search-local * Uninstall algolia Closes: #535 Signed-off-by: Wilfred Spiegelenburg <wilfreds@apache.org>
1 parent fb2dbb8 commit c9c4904

3 files changed

Lines changed: 394 additions & 25 deletions

File tree

docusaurus.config.js

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,48 @@ Copyright © 2020-${new Date().getFullYear()} <a href="https://www.apache.org/">
220220
</div>
221221
</div>`
222222
},
223-
algolia: {
224-
appId: 'Q1V951BG2V',
225-
apiKey: '9ae3e2f7a01a21300490729dfb9f2a51',
226-
indexName: 'yunikorn',
227-
contextualSearch: true,
228-
},
229-
}
223+
},
224+
plugins: [
225+
[
226+
"@cmfcmf/docusaurus-search-local",
227+
{
228+
// whether to index docs pages
229+
indexDocs: true,
230+
231+
// Whether to also index the titles of the parent categories in the sidebar of a doc page.
232+
// 0 disables this feature.
233+
// 1 indexes the direct parent category in the sidebar of a doc page
234+
// 2 indexes up to two nested parent categories of a doc page
235+
// 3...
236+
//
237+
// Do _not_ use Infinity, the value must be a JSON-serializable integer.
238+
indexDocSidebarParentCategories: 0,
239+
240+
// Includes parent categories path in search result
241+
includeParentCategoriesInPageTitle: false,
242+
243+
// whether to index blog pages
244+
indexBlog: true,
245+
246+
// whether to index static pages
247+
// /404.html is never indexed
248+
indexPages: false,
249+
250+
// language of your documentation, see next section
251+
language: "en",
252+
253+
// setting this to "none" will prevent the default CSS to be included. The default CSS
254+
// comes from autocomplete-theme-classic, which you can read more about here:
255+
// https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-theme-classic/
256+
// When you want to overwrite CSS variables defined by the default theme, make sure to suffix your
257+
// overwrites with `!important`, because they might otherwise not be applied as expected. See the
258+
// following comment for more information: https://github.com/cmfcmf/docusaurus-search-local/issues/107#issuecomment-1119831938.
259+
style: undefined,
260+
261+
// The maximum number of search results shown to the user. This does _not_ affect performance of
262+
// searches, but simply does not display additional search results that have been found.
263+
maxSearchResults: 8,
264+
},
265+
],
266+
],
230267
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"release": "docusaurus docs:version"
1313
},
1414
"dependencies": {
15+
"@cmfcmf/docusaurus-search-local": "^2.0.1",
1516
"@docusaurus/core": "3.9.2",
1617
"@docusaurus/preset-classic": "3.9.2",
17-
"@docusaurus/theme-search-algolia": "3.9.2",
1818
"@mdx-js/react": "^3.0.1",
1919
"axios": "^1.7.7",
2020
"clsx": "^2.1.1",

0 commit comments

Comments
 (0)