Skip to content

Commit f6ce3e5

Browse files
authored
😀: add i18n and search bar (#13)
* 😱: important change add i18n support * 😱: break change on i18n and post some en translation * 😱: add search bar and main page translation in en
1 parent 54917bb commit f6ce3e5

40 files changed

+2757
-36
lines changed

docs/tutorial-basics/create-a-blog-post.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ sidebar_label: '如何发送一个更新状态'
33
sidebar_position: 3
44
---
55

6-
```angular2html
6+
:::warning
77
本文多数取自官方的说明,用于告诉有贡献想法的如何添加或修改页面。
8-
```
8+
:::
99

1010
# 发送更新状况
1111

docs/tutorial-basics/create-a-document.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ sidebar_label: '如何新建一个文档'
33
sidebar_position: 2
44
---
55

6-
```angular2html
6+
:::warning
77
本文多数取自官方的说明,用于告诉有贡献想法的如何添加或修改页面。
8-
```
8+
:::
99

1010
# 如何创建一个文档
1111

@@ -60,5 +60,3 @@ export default {
6060
],
6161
};
6262
```
63-
64-
特别的,本项目使用 ts,所以侧边栏

docs/tutorial-basics/create-a-page.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ sidebar_label: '如何新建一个页面'
33
sidebar_position: 1
44
---
55

6-
```angular2html
6+
:::warning
77
本文多数取自官方的说明,用于告诉有贡献想法的如何添加或修改页面。
8-
```
8+
:::
99

1010
# 如何新建一个页面
1111

docs/tutorial-basics/deploy-your-site.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ sidebar_label: '手动部署'
33
sidebar_position: 4
44
---
55

6-
```angular2html
6+
:::warning
77
本文多数取自官方的说明,用于告诉有贡献想法的如何添加或修改页面。
8-
```
8+
:::
99

1010
# 部署网站
1111

docusaurus.config.ts

+23-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,26 @@ const config: Config = {
1616
onBrokenLinks: 'throw',
1717
onBrokenMarkdownLinks: 'warn',
1818

19+
plugins: [
20+
[
21+
require.resolve("docusaurus-lunr-search"),
22+
{
23+
languages: ['zh', 'en'],
24+
},
25+
],
26+
],
27+
1928
i18n: {
20-
defaultLocale: 'zh-cn',
21-
locales: ['zh-cn'],
29+
defaultLocale: 'zh-CN',
30+
locales: ['zh-CN', 'en-US'],
31+
localeConfigs: {
32+
'zh-CN': {
33+
htmlLang: 'zh-CN',
34+
},
35+
'en-US': {
36+
htmlLang: 'en-US',
37+
},
38+
},
2239
},
2340

2441
presets: [
@@ -81,6 +98,10 @@ const config: Config = {
8198
{ to: 'docs/note-np/intro', label: '神经与精神病学', position: 'left'},
8299
{ to: 'docs/note-cps/intro', label: '临床技能实践', position: 'left'},
83100
{ to: 'blog', label: '更新', position: 'left' },
101+
{
102+
type: 'localeDropdown',
103+
position: 'right',
104+
},
84105
{
85106
href: 'https://github.com/chitsanfei/monster-medical-learning-book',
86107
label: 'GitHub',

0 commit comments

Comments
 (0)