summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliruifengv2024-03-01 01:16:31 +0800
committerGitHub2024-02-29 18:16:31 +0100
commita8ea6f08c11e46f55e3c20e77c197284b1e7061a (patch)
tree873a19bdc78ca2098ea1d38fe5942610d953010d
parent585ac3f7c122fb1848537c2a0ee0e3bba016a184 (diff)
downloadIT.starlight-a8ea6f08c11e46f55e3c20e77c197284b1e7061a.tar.gz
IT.starlight-a8ea6f08c11e46f55e3c20e77c197284b1e7061a.tar.bz2
IT.starlight-a8ea6f08c11e46f55e3c20e77c197284b1e7061a.zip
i18n(zh-cn): Update pages.mdx (#1565)
* i18n(zh-cn): Update pages.mdx * Update page labels and titles in Chinese --------- Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--docs/src/content/docs/zh-cn/guides/pages.mdx40
1 files changed, 31 insertions, 9 deletions
diff --git a/docs/src/content/docs/zh-cn/guides/pages.mdx b/docs/src/content/docs/zh-cn/guides/pages.mdx
index 4d0cc406..634fd034 100644
--- a/docs/src/content/docs/zh-cn/guides/pages.mdx
+++ b/docs/src/content/docs/zh-cn/guides/pages.mdx
@@ -106,15 +106,37 @@ import CustomComponent from './CustomComponent.astro';
- [`slug`](/zh-cn/reference/frontmatter/#slug) 属性不受支持,并且会根据自定义页面的 URL 自动设置。
- [`editUrl`](/zh-cn/reference/frontmatter/#editurl) 选项需要一个 URL 来显示编辑链接。
-- [`sidebar`](/zh-cn/reference/frontmatter/#sidebar) 属性不受支持。在 Markdown frontmatter 中,此选项允许自定义[自动生成的链接组](/zh-cn/reference/configuration/#sidebar),这不适用于使用 `<StarlightPage />` 组件的页面。
-
-{/* ##### `sidebar` */}
-
-{/* **type:** `SidebarEntry[] | undefined` */}
-{/* **default:** the sidebar generated based on the [global `sidebar` config](/reference/configuration/#sidebar) */}
-
-{/* Provide a custom site navigation sidebar for this page. */}
-{/* If not set, the page will use the default global sidebar. */}
+- 用于自定义页面如何在 [自动生成的链接组](/zh-cn/reference/configuration/#sidebar) 中显示的 [`sidebar`](/zh-cn/reference/frontmatter/#sidebar) frontmatter 属性不可用。使用 `<StarlightPage />` 组件的页面不是集合的一部分,不能添加到自动生成的侧边栏组中。
+
+##### `sidebar`
+
+**类型:** `SidebarEntry[]`
+**默认值:** 根据 [全局 `sidebar` 配置](/zh-cn/reference/configuration/#sidebar) 生成的侧边栏
+
+为此页面提供自定义站点导航侧边栏。
+如果未设置,此页面将使用默认的全局侧边栏。
+
+例如,以下页面使用指向主页的链接和一组指向不同星座的链接覆盖了默认的侧边栏。
+侧边栏中的当前页面使用 `isCurrent` 属性设置,一个可选的 `badge` 已经添加到了一个链接项中。
+
+```astro {3-13}
+<StarlightPage
+ frontmatter={{ title: '猎户座' }}
+ sidebar={[
+ { label: '首页', href: '/' },
+ {
+ label: '星座',
+ items: [
+ { label: '仙女座', href: '/andromeda/' },
+ { label: '猎户座', href: '/orion/', isCurrent: true },
+ { label: '射手座', href: '/sagittarius/', badge: 'Stub' },
+ ],
+ },
+ ]}
+>
+ 示例内容。
+</StarlightPage>
+```
##### `hasSidebar`