|
1 | 1 | // @ts-check |
2 | 2 | // Note: type annotations allow type checking and IDEs autocompletion |
3 | 3 |
|
4 | | -const lightCodeTheme = require('prism-react-renderer/themes/github'); |
5 | | -const darkCodeTheme = require('prism-react-renderer/themes/dracula'); |
| 4 | +const lightCodeTheme = require("prism-react-renderer/themes/github"); |
| 5 | +const darkCodeTheme = require("prism-react-renderer/themes/dracula"); |
6 | 6 |
|
7 | 7 | /** @type {import('@docusaurus/types').Config} */ |
8 | 8 | const config = { |
9 | | - title: 'Elasticsearch 中文文档', |
10 | | - tagline: 'Elasticsearch 中文文档', |
11 | | - favicon: 'img/favicon.ico', |
| 9 | + title: "Elasticsearch 中文文档", |
| 10 | + tagline: "Elasticsearch 中文文档", |
| 11 | + favicon: "img/favicon.ico", |
12 | 12 |
|
13 | 13 | // Set the production url of your site here |
14 | | - url: 'https://elasticsearch.bookhub.tech', |
| 14 | + url: "https://elasticsearch.bookhub.tech", |
15 | 15 | // Set the /<baseUrl>/ pathname under which your site is served |
16 | 16 | // For GitHub pages deployment, it is often '/<projectName>/' |
17 | | - baseUrl: '/', |
| 17 | + baseUrl: "/", |
18 | 18 |
|
19 | 19 | // GitHub pages deployment config. |
20 | 20 | // If you aren't using GitHub pages, you don't need these. |
21 | | - organizationName: 'dev2007', // Usually your GitHub org/user name. |
22 | | - projectName: 'elasticsearch-doc', // Usually your repo name. |
| 21 | + organizationName: "dev2007", // Usually your GitHub org/user name. |
| 22 | + projectName: "elasticsearch-doc", // Usually your repo name. |
23 | 23 |
|
24 | | - onBrokenLinks: 'warn', |
25 | | - onBrokenMarkdownLinks: 'warn', |
| 24 | + onBrokenLinks: "warn", |
| 25 | + onBrokenMarkdownLinks: "warn", |
26 | 26 |
|
27 | 27 | // Even if you don't use internalization, you can use this field to set useful |
28 | 28 | // metadata like html lang. For example, if your site is Chinese, you may want |
29 | 29 | // to replace "en" with "zh-Hans". |
30 | 30 | i18n: { |
31 | | - defaultLocale: 'zh', |
32 | | - locales: ['zh'], |
| 31 | + defaultLocale: "zh", |
| 32 | + locales: ["zh"], |
33 | 33 | }, |
34 | 34 |
|
35 | 35 | presets: [ |
36 | 36 | [ |
37 | | - 'classic', |
| 37 | + "classic", |
38 | 38 | /** @type {import('@docusaurus/preset-classic').Options} */ |
39 | 39 | ({ |
40 | 40 | docs: { |
41 | | - routeBasePath: '/', |
42 | | - sidebarPath: require.resolve('./sidebars.js'), |
| 41 | + routeBasePath: "/", |
| 42 | + sidebarPath: require.resolve("./sidebars.js"), |
43 | 43 | }, |
44 | 44 | blog: false, |
45 | 45 | theme: { |
46 | | - customCss: require.resolve('./src/css/custom.css'), |
| 46 | + customCss: require.resolve("./src/css/custom.css"), |
47 | 47 | }, |
48 | 48 | }), |
49 | 49 | ], |
50 | 50 | ], |
51 | 51 |
|
52 | 52 | scripts: [ |
53 | 53 | { |
54 | | - src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8380975615223941', |
55 | | - crossorigin: 'anonymous' |
| 54 | + src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8380975615223941", |
| 55 | + crossorigin: "anonymous", |
56 | 56 | }, |
57 | 57 | { |
58 | | - src: 'https://hm.baidu.com/hm.js?085b01fdb8056cdc09e3d19350818e33', |
59 | | - async: true |
60 | | - } |
| 58 | + src: "https://hm.baidu.com/hm.js?085b01fdb8056cdc09e3d19350818e33", |
| 59 | + async: true, |
| 60 | + }, |
61 | 61 | ], |
62 | 62 |
|
63 | 63 | themeConfig: |
64 | 64 | /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ |
65 | 65 | ({ |
66 | 66 | // Replace with your project's social card |
67 | | - docs:{ |
| 67 | + docs: { |
68 | 68 | sidebar: { |
69 | 69 | hideable: true, |
70 | 70 | }, |
71 | 71 | }, |
72 | | - metadata: [{ name: 'keywords', content: 'Elastic,Elasticsearch,ElasticStack,ELK,Document,docs,文档,中文文档,入门' }], |
| 72 | + metadata: [ |
| 73 | + { |
| 74 | + name: "keywords", |
| 75 | + content: |
| 76 | + "Elastic,Elasticsearch,Elasticsearch api,ElasticStack,ELK,Document,docs,文档,中文文档,入门", |
| 77 | + }, |
| 78 | + ], |
73 | 79 | navbar: { |
74 | | - title: 'Elasticsearch 中文文档', |
| 80 | + title: "Elasticsearch 中文文档", |
75 | 81 | logo: { |
76 | | - alt: 'elasticsearch Logo', |
77 | | - src: 'img/favicon.ico', |
| 82 | + alt: "elasticsearch Logo", |
| 83 | + src: "img/favicon.ico", |
78 | 84 | }, |
79 | 85 | items: [ |
80 | 86 | { |
81 | | - href: 'https://www.bookhub.tech', |
82 | | - label: 'BookHub 首页', |
83 | | - position: 'right', |
| 87 | + href: "https://www.bookhub.tech", |
| 88 | + label: "BookHub 首页", |
| 89 | + position: "right", |
84 | 90 | }, |
85 | 91 | { |
86 | | - href: 'https://docs.bookhub.tech', |
87 | | - label: '中文文档', |
88 | | - position: 'right', |
| 92 | + href: "https://docs.bookhub.tech", |
| 93 | + label: "中文文档", |
| 94 | + position: "right", |
89 | 95 | }, |
90 | 96 | { |
91 | | - href: 'https://github.com/dev2007/elasticsearch-doc', |
92 | | - position: 'right', |
93 | | - className: 'header-github-link', |
94 | | - 'aria-label': 'GitHub 仓库', |
| 97 | + href: "https://github.com/dev2007/elasticsearch-doc", |
| 98 | + position: "right", |
| 99 | + className: "header-github-link", |
| 100 | + "aria-label": "GitHub 仓库", |
95 | 101 | }, |
96 | 102 | { |
97 | | - type: 'search', |
98 | | - position: 'right', |
| 103 | + type: "search", |
| 104 | + position: "right", |
99 | 105 | }, |
100 | 106 | ], |
101 | 107 | }, |
102 | 108 | footer: { |
103 | | - style: 'dark', |
| 109 | + style: "dark", |
104 | 110 | links: [ |
105 | 111 | { |
106 | | - title: 'BookHub', |
| 112 | + title: "BookHub", |
107 | 113 | items: [ |
108 | 114 | { |
109 | | - label: '首页', |
110 | | - href: 'https://www.bookhub.tech' |
| 115 | + label: "首页", |
| 116 | + href: "https://www.bookhub.tech", |
111 | 117 | }, |
112 | 118 | { |
113 | | - label: '中文文档', |
114 | | - href: 'https://docs.bookhub.tech', |
| 119 | + label: "中文文档", |
| 120 | + href: "https://docs.bookhub.tech", |
115 | 121 | }, |
116 | 122 | ], |
117 | 123 | }, |
118 | 124 | { |
119 | | - title: '其他文档', |
| 125 | + title: "其他文档", |
120 | 126 | items: [ |
121 | 127 | { |
122 | | - label: 'Micronaut', |
123 | | - href: 'https://micronaut.bookhub.tech', |
| 128 | + label: "Micronaut", |
| 129 | + href: "https://micronaut.bookhub.tech", |
124 | 130 | }, |
125 | 131 | { |
126 | | - label: 'MySQL', |
127 | | - href: 'https://mysql.bookhub.tech', |
| 132 | + label: "Pac4j", |
| 133 | + href: "https://pac4j.bookhub.tech", |
128 | 134 | }, |
129 | | - { |
130 | | - label: 'Pac4j', |
131 | | - href: 'https://pac4j.bookhub.tech', |
132 | | - } |
133 | 135 | ], |
134 | | - } |
| 136 | + }, |
135 | 137 | ], |
136 | 138 | copyright: `Copyright © ${new Date().getFullYear()} bookHub.tech`, |
137 | 139 | }, |
138 | 140 | prism: { |
139 | 141 | theme: lightCodeTheme, |
140 | 142 | darkTheme: darkCodeTheme, |
141 | | - additionalLanguages: ['bash', 'java', 'yaml', 'json', 'groovy', 'kotlin', 'graphql', 'properties', 'toml', 'hoon'] |
| 143 | + additionalLanguages: [ |
| 144 | + "bash", |
| 145 | + "java", |
| 146 | + "yaml", |
| 147 | + "json", |
| 148 | + "groovy", |
| 149 | + "kotlin", |
| 150 | + "graphql", |
| 151 | + "properties", |
| 152 | + "toml", |
| 153 | + "hoon", |
| 154 | + ], |
142 | 155 | }, |
143 | 156 | }), |
144 | | - |
145 | | - plugins: [[ require.resolve('docusaurus-lunr-search'), { |
146 | | - languages: ['en', 'zh'] // language codes |
147 | | - }]], |
| 157 | + |
| 158 | + plugins: [ |
| 159 | + [ |
| 160 | + require.resolve("docusaurus-lunr-search"), |
| 161 | + { |
| 162 | + languages: ["en", "zh"], // language codes |
| 163 | + }, |
| 164 | + ], |
| 165 | + ], |
148 | 166 | }; |
149 | 167 |
|
150 | 168 | module.exports = config; |
0 commit comments