Skip to content

Commit e5163b9

Browse files
authored
[Web] Fix doc search function (#43)
1 parent 34dcc5f commit e5163b9

File tree

3 files changed

+604
-79
lines changed

3 files changed

+604
-79
lines changed

docusaurus.config.js

Lines changed: 49 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,53 @@ module.exports = {
1212

1313
/** @type {import('@docusaurus/types').Config} */
1414
const config = {
15-
title: 'Notebook',
16-
tagline: '',
17-
url: 'https://space.keter.top',
18-
baseUrl: '/',
19-
onBrokenLinks: 'throw',
20-
onBrokenMarkdownLinks: 'warn',
21-
favicon: 'img/favicon.ico',
22-
organizationName: 'facebook', // Usually your GitHub org/user name.
23-
projectName: 'CUDATutorial', // Usually your repo name.
15+
title: 'Notebook',
16+
tagline: '',
17+
url: 'https://space.keter.top',
18+
baseUrl: '/',
19+
onBrokenLinks: 'throw',
20+
onBrokenMarkdownLinks: 'warn',
21+
favicon: 'img/favicon.ico',
22+
organizationName: 'facebook', // Usually your GitHub org/user name.
23+
projectName: 'CUDATutorial', // Usually your repo name.
2424

25-
presets: [
26-
[
27-
'classic',
28-
/** @type {import('@docusaurus/preset-classic').Options} */
29-
({
30-
docs: {
31-
sidebarPath: require.resolve('./sidebars.js'),
32-
// Please change this to your repo.
33-
routeBasePath: '/',
34-
editUrl: 'https://github.com/PaddleJitLab/CUDATutorial/tree/develop',
35-
remarkPlugins: [math],
36-
rehypePlugins: [katex],
37-
},
38-
blog: {
39-
showReadingTime: true,
40-
// Please change this to your repo.
41-
routeBasePath: '/',
42-
editUrl:
43-
'https://github.com/PaddleJitLab/CUDATutorial/tree/develop',
44-
},
45-
theme: {
46-
customCss: require.resolve('./src/css/custom.css'),
47-
},
48-
}),
25+
presets: [
26+
[
27+
'classic',
28+
/** @type {import('@docusaurus/preset-classic').Options} */
29+
({
30+
docs: {
31+
sidebarPath: require.resolve('./sidebars.js'),
32+
// Please change this to your repo.
33+
routeBasePath: '/',
34+
editUrl: 'https://github.com/PaddleJitLab/CUDATutorial/tree/develop',
35+
remarkPlugins: [math],
36+
rehypePlugins: [katex],
37+
},
38+
blog: {
39+
showReadingTime: true,
40+
// Please change this to your repo.
41+
routeBasePath: '/',
42+
editUrl:
43+
'https://github.com/PaddleJitLab/CUDATutorial/tree/develop',
44+
},
45+
theme: {
46+
customCss: require.resolve('./src/css/custom.css'),
47+
},
48+
}),
49+
],
4950
],
50-
],
5151

52-
plugins: [
53-
[
54-
require.resolve("@easyops-cn/docusaurus-search-local"),
55-
{
56-
// ... Your options.
57-
// `hashed` is recommended as long-term-cache of index file is possible.
58-
hashed: true,
59-
// For Docs using Chinese, The `language` is recommended to set to:
60-
// ```
61-
language: ["zh"],
62-
// ```
63-
// When applying `zh` in language, please install `nodejieba` in your project.
64-
translations: {
65-
search_placeholder: "Search",
66-
see_all_results: "See all results",
67-
no_results: "No results.",
68-
search_results_for: 'Search results for "{{ keyword }}"',
69-
search_the_documentation: "Search the documentation",
70-
count_documents_found: "{{ count }} document found",
71-
count_documents_found_plural: "{{ count }} documents found",
72-
no_documents_were_found: "No documents were found",
73-
},
74-
},
52+
plugins: [
53+
[
54+
require.resolve("@cmfcmf/docusaurus-search-local"),
55+
{
56+
language: "zh",
57+
}
58+
],
7559
],
76-
],
7760

78-
themeConfig:
61+
themeConfig:
7962
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
8063
({
8164
metadata: [
@@ -109,13 +92,13 @@ const config = {
10992
},
11093
}),
11194
stylesheets: [
112-
{
113-
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
114-
type: 'text/css',
115-
integrity:
116-
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
117-
crossorigin: 'anonymous',
118-
},
95+
{
96+
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
97+
type: 'text/css',
98+
integrity:
99+
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
100+
crossorigin: 'anonymous',
101+
},
119102
],
120103
};
121104

0 commit comments

Comments
 (0)