Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): Update sidebar.mdx & configuration.mdx #1022

Merged
merged 6 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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