Skip to content

Commit

Permalink
i18n(zh-cn): Update sidebar.mdx & configuration.mdx (#1022)
Browse files Browse the repository at this point in the history
Co-authored-by: Xiaoyue Lin <[email protected]>
  • Loading branch information
liruifengv and 100gle authored Nov 2, 2023
1 parent 5318543 commit 5499c25
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 25 additions & 1 deletion docs/src/content/docs/zh-cn/guides/sidebar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ sidebar:

## 徽章

链接也可以包含一个 `badge` 属性,以在链接标签旁边显示徽章
链接、分组、自动生成的分组都可以包含一个 `badge` 属性,以在它们的标签旁边显示徽章

```js
starlight({
Expand All @@ -249,6 +249,12 @@ starlight({
},
],
},
// 一个带有 "Deprecated" 徽章的自动生成分组。
{
label: 'Reference',
badge: 'Deprecated',
autogenerate: { directory: 'reference' },
},
],
});
```
Expand All @@ -267,6 +273,24 @@ starlight({
},
],
},
{
label: 'Reference',
badge: { text: 'Deprecated', variant: 'default' },
items: [
{
label: 'Configuration Reference',
link: '/reference/configuration/',
},
{
label: 'Frontmatter Reference',
link: '/reference/frontmatter/',
},
{
label: 'Overrides Reference',
link: '/reference/overrides/',
},
],
},
]}
/>

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/zh-cn/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ sidebar: [
type SidebarItem = {
label: string;
translations?: Record<string, string>;
badge?: string | BadgeConfig;
} & (
| {
link: string;
badge?: string | BadgeConfig;
attrs?: Record<string, string | number | boolean | undefined>;
}
| { items: SidebarItem[]; collapsed?: boolean }
Expand Down

0 comments on commit 5499c25

Please sign in to comment.