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 overrides.md #1334

Merged
merged 3 commits into from
Jan 4, 2024
Merged
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
13 changes: 13 additions & 0 deletions docs/src/content/docs/zh-cn/reference/overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tableOfContents:

```astro
---
// src/components/Custom.astro
import type { Props } from '@astrojs/starlight/props';

const { hasSidebar } = Astro.props;
Expand Down Expand Up @@ -134,6 +135,12 @@ entry: {

如果启用了,表示可以编辑此页面的地址的 JavaScript `URL` 对象。

#### `labels`

**类型:** `Record<string, string>`

一个包含为当前页面本地化的 UI 字符串的对象。请参阅 [“翻译 Starlight UI”](/zh-cn/guides/i18n/#翻译-starlight-的-ui) 指南以获取所有可用键的列表。

---

## 组件
Expand Down Expand Up @@ -227,6 +234,10 @@ entry: {
用于渲染 Starlight 搜索 UI 的组件。
默认实现包含在导航栏中的按钮和在点击时显示搜索模态框以及加载 [Pagefind UI](https://pagefind.app/) 的代码。

当 [`pagefind`](/zh-cn/reference/configuration/#pagefind) 被禁用时,默认的搜索组件不会被渲染。
然而,如果你重写了 `Search`,你的自定义组件将总是被渲染,即使 `pagefind` 配置选项是 `false`。
这允许你在禁用 Pagefind 时为其他搜索提供商添加 UI。

#### `SocialIcons`

**默认组件:** [`SocialIcons.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/SocialIcons.astro)
Expand Down Expand Up @@ -342,6 +353,8 @@ Starlight 的页面侧边栏负责显示当前页面的子标题的目录。
在页面主内容列中渲染 Markdown 内容的组件。
默认实现为 Markdown 内容提供了基本的样式。

Markdown 内容样式也暴露在 `@astrojs/starlight/style/markdown.css` 中,并且作用域限制在 `.sl-markdown-content` CSS 类中。

---

### 页脚
Expand Down