Skip to content

Commit b7b17b8

Browse files
authored
Update version link, add changelog & i18n (#570)
Change the navbar version item to point to a new comparison URL and rename it to "版本对比"; remove the Gitee navbar link. Add a "更新日志" (changelog) link to sidebars and versioned sidebars. Update zh-Hans translations: reorganize and add several theme strings (copy/copyed labels for code blocks, TOC/ARIA labels, reading time, breadcrumbs, etc.) to support the new UI items. Minor JSON formatting cleanups in versioned sidebars.
1 parent 0a9b5b6 commit b7b17b8

File tree

7 files changed

+71
-63
lines changed

7 files changed

+71
-63
lines changed

docusaurus.config.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,15 @@ const config = {
150150
position: "right",
151151
},
152152
{
153-
href: "https://releases.halo.run",
154-
label: "版本",
153+
href: "https://www.lxware.cn/halo?code=mcYhwMkn",
154+
label: "版本对比",
155155
position: "right",
156156
},
157157
{
158158
href: "https://github.com/halo-dev/halo",
159159
label: "GitHub",
160160
position: "right",
161161
},
162-
{
163-
href: "https://gitee.com/halo-dev/halo",
164-
label: "Gitee",
165-
position: "right",
166-
},
167162
],
168163
},
169164
footer: {

i18n/zh-Hans/code.json

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@
9696
"theme.docs.versionBadge.label": {
9797
"message": "版本:{versionLabel}"
9898
},
99-
"theme.common.editThisPage": {
100-
"message": "编辑此页",
101-
"description": "The link label to edit the current page"
102-
},
10399
"theme.docs.versions.unreleasedVersionLabel": {
104100
"message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。",
105101
"description": "The label used to tell the user that he's browsing an unreleased doc version"
@@ -116,6 +112,10 @@
116112
"message": "最新版本",
117113
"description": "The label used for the latest version suggestion link label"
118114
},
115+
"theme.common.editThisPage": {
116+
"message": "编辑此页",
117+
"description": "The link label to edit the current page"
118+
},
119119
"theme.common.headingLinkTitle": {
120120
"message": "{heading}的直接链接",
121121
"description": "Title for link to heading"
@@ -144,6 +144,10 @@
144144
"message": "标签:",
145145
"description": "The label alongside a tag list"
146146
},
147+
"theme.AnnouncementBar.closeButtonAriaLabel": {
148+
"message": "关闭",
149+
"description": "The ARIA label for close button of announcement bar"
150+
},
147151
"theme.admonition.caution": {
148152
"message": "警告",
149153
"description": "The default label used for the Caution admonition (:::caution)"
@@ -172,10 +176,6 @@
172176
"message": "最近博文导航",
173177
"description": "The ARIA label for recent posts in the blog sidebar"
174178
},
175-
"theme.AnnouncementBar.closeButtonAriaLabel": {
176-
"message": "关闭",
177-
"description": "The ARIA label for close button of announcement bar"
178-
},
179179
"theme.DocSidebarItem.expandCategoryAriaLabel": {
180180
"message": "展开侧边栏分类 '{label}'",
181181
"description": "The ARIA label to expand the sidebar category"
@@ -192,6 +192,10 @@
192192
"message": "主导航",
193193
"description": "The ARIA label for the main navigation"
194194
},
195+
"theme.TOCCollapsible.toggleButtonLabel": {
196+
"message": "本页总览",
197+
"description": "The label used by the button on the collapsible TOC component"
198+
},
195199
"theme.NotFound.p1": {
196200
"message": "我们找不到您要找的页面。",
197201
"description": "The first paragraph of the 404 page"
@@ -200,14 +204,26 @@
200204
"message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。",
201205
"description": "The 2nd paragraph of the 404 page"
202206
},
203-
"theme.TOCCollapsible.toggleButtonLabel": {
204-
"message": "本页总览",
205-
"description": "The label used by the button on the collapsible TOC component"
206-
},
207207
"theme.navbar.mobileLanguageDropdown.label": {
208208
"message": "选择语言",
209209
"description": "The label for the mobile language switcher dropdown"
210210
},
211+
"theme.blog.post.readingTime.plurals": {
212+
"message": "阅读需 {readingTime} 分钟",
213+
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
214+
},
215+
"theme.CodeBlock.copy": {
216+
"message": "复制",
217+
"description": "The copy button label on code blocks"
218+
},
219+
"theme.CodeBlock.copied": {
220+
"message": "复制成功",
221+
"description": "The copied button label on code blocks"
222+
},
223+
"theme.CodeBlock.copyButtonAriaLabel": {
224+
"message": "复制代码到剪贴板",
225+
"description": "The ARIA label for copy code blocks button"
226+
},
211227
"theme.blog.post.readMore": {
212228
"message": "阅读更多",
213229
"description": "The label used in blog post item excerpts to link to full blog posts"
@@ -216,22 +232,10 @@
216232
"message": "阅读 {title} 的全文",
217233
"description": "The ARIA label for the link to full blog posts from excerpts"
218234
},
219-
"theme.blog.post.readingTime.plurals": {
220-
"message": "阅读需 {readingTime} 分钟",
221-
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
222-
},
223235
"theme.CodeBlock.wordWrapToggle": {
224236
"message": "切换自动换行",
225237
"description": "The title attribute for toggle word wrapping button of code block lines"
226238
},
227-
"theme.docs.sidebar.navAriaLabel": {
228-
"message": "文档侧边栏",
229-
"description": "The ARIA label for the sidebar navigation"
230-
},
231-
"theme.docs.breadcrumbs.home": {
232-
"message": "主页面",
233-
"description": "The ARIA label for the home page in the breadcrumbs"
234-
},
235239
"theme.docs.sidebar.collapseButtonTitle": {
236240
"message": "收起侧边栏",
237241
"description": "The title attribute for collapse button of doc sidebar"
@@ -240,25 +244,13 @@
240244
"message": "收起侧边栏",
241245
"description": "The title attribute for collapse button of doc sidebar"
242246
},
243-
"theme.CodeBlock.copy": {
244-
"message": "复制",
245-
"description": "The copy button label on code blocks"
246-
},
247-
"theme.CodeBlock.copied": {
248-
"message": "复制成功",
249-
"description": "The copied button label on code blocks"
250-
},
251-
"theme.CodeBlock.copyButtonAriaLabel": {
252-
"message": "复制代码到剪贴板",
253-
"description": "The ARIA label for copy code blocks button"
254-
},
255-
"theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": {
256-
"message": "Expand the dropdown",
257-
"description": "The ARIA label of the button to expand the mobile dropdown navbar item"
247+
"theme.docs.breadcrumbs.home": {
248+
"message": "主页面",
249+
"description": "The ARIA label for the home page in the breadcrumbs"
258250
},
259-
"theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": {
260-
"message": "Collapse the dropdown",
261-
"description": "The ARIA label of the button to collapse the mobile dropdown navbar item"
251+
"theme.docs.sidebar.navAriaLabel": {
252+
"message": "文档侧边栏",
253+
"description": "The ARIA label for the sidebar navigation"
262254
},
263255
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
264256
"message": "关闭导航栏",
@@ -272,6 +264,14 @@
272264
"message": "切换导航栏",
273265
"description": "The ARIA label for hamburger menu button of mobile navigation"
274266
},
267+
"theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": {
268+
"message": "Expand the dropdown",
269+
"description": "The ARIA label of the button to expand the mobile dropdown navbar item"
270+
},
271+
"theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": {
272+
"message": "Collapse the dropdown",
273+
"description": "The ARIA label of the button to collapse the mobile dropdown navbar item"
274+
},
275275
"theme.docs.sidebar.expandButtonTitle": {
276276
"message": "展开侧边栏",
277277
"description": "The ARIA label and title attribute for expand button of doc sidebar"

i18n/zh-Hans/docusaurus-plugin-content-docs/current.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
"message": "Rainbond 一键部署",
4040
"description": "The label for link 'Rainbond 一键部署' in sidebar 'tutorial', linking to 'https://hub.grapps.cn/marketplace/apps/1255'"
4141
},
42+
"sidebar.tutorial.link.更新日志": {
43+
"message": "更新日志",
44+
"description": "The label for link '更新日志' in sidebar 'tutorial', linking to 'https://releases.halo.run/changelog'"
45+
},
4246
"sidebar.developer.category.系统开发": {
4347
"message": "系统开发",
4448
"description": "The label for category '系统开发' in sidebar 'developer'"

i18n/zh-Hans/docusaurus-plugin-content-docs/version-2.23.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
"message": "Rainbond 一键部署",
4040
"description": "The label for link 'Rainbond 一键部署' in sidebar 'tutorial', linking to 'https://hub.grapps.cn/marketplace/apps/1255'"
4141
},
42+
"sidebar.tutorial.link.更新日志": {
43+
"message": "更新日志",
44+
"description": "The label for link '更新日志' in sidebar 'tutorial', linking to 'https://releases.halo.run/changelog'"
45+
},
4246
"sidebar.developer.category.系统开发": {
4347
"message": "系统开发",
4448
"description": "The label for category '系统开发' in sidebar 'developer'"

i18n/zh-Hans/docusaurus-theme-classic/navbar.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"message": "论坛",
2424
"description": "Navbar item with label 论坛"
2525
},
26-
"item.label.版本": {
27-
"message": "版本",
28-
"description": "Navbar item with label 版本"
26+
"item.label.版本对比": {
27+
"message": "版本对比",
28+
"description": "Navbar item with label 版本对比"
2929
},
3030
"item.label.GitHub": {
3131
"message": "GitHub",

sidebars.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ module.exports = {
135135
items: ["contribution/issue", "contribution/pr"],
136136
},
137137
"about",
138+
{
139+
type: "link",
140+
label: "更新日志",
141+
href: "https://releases.halo.run/changelog",
142+
description: "查看 Halo 的更新日志",
143+
}
138144
],
139145

140146
developer: [

versioned_sidebars/version-2.23-sidebars.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,15 @@
114114
"link": {
115115
"type": "generated-index"
116116
},
117-
"items": [
118-
"contribution/issue",
119-
"contribution/pr"
120-
]
117+
"items": ["contribution/issue", "contribution/pr"]
121118
},
122-
"about"
119+
"about",
120+
{
121+
"type": "link",
122+
"label": "更新日志",
123+
"href": "https://releases.halo.run/changelog",
124+
"description": "查看 Halo 的更新日志"
125+
}
123126
],
124127
"developer": [
125128
{
@@ -344,9 +347,7 @@
344347
"link": {
345348
"type": "generated-index"
346349
},
347-
"items": [
348-
"developer-guide/plugin/examples/todolist"
349-
]
350+
"items": ["developer-guide/plugin/examples/todolist"]
350351
},
351352
"developer-guide/plugin/api-changelog"
352353
]
@@ -431,9 +432,7 @@
431432
"link": {
432433
"type": "generated-index"
433434
},
434-
"items": [
435-
"developer-guide/appendix/publish-app"
436-
]
435+
"items": ["developer-guide/appendix/publish-app"]
437436
}
438437
]
439438
}

0 commit comments

Comments
 (0)