Skip to content

Commit 22524dc

Browse files
authored
Merge branch 'main' into add-themes
2 parents 9f8ec2a + 04a4f4b commit 22524dc

5 files changed

Lines changed: 79 additions & 41 deletions

File tree

docs/src/content/docs/zh-cn/components/badges.mdx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,31 @@ import { Badge } from '@astrojs/starlight/components';
3333
```mdx
3434
import { Badge } from '@astrojs/starlight/components';
3535

36-
<Badge text="注释" variant="note" />
37-
<Badge text="成功" variant="success" />
38-
<Badge text="提示" variant="tip" />
39-
<Badge text="注意" variant="caution" />
40-
<Badge text="危险" variant="danger" />
36+
- <Badge text="注释" variant="note" />
37+
- <Badge text="成功" variant="success" />
38+
- <Badge text="提示" variant="tip" />
39+
- <Badge text="注意" variant="caution" />
40+
- <Badge text="危险" variant="danger" />
4141
```
4242

4343
<Fragment slot="markdoc">
4444

4545
```markdoc
46-
{% badge text="注释" variant="note" /%}
47-
{% badge text="成功" variant="success" /%}
48-
{% badge text="提示" variant="tip" /%}
49-
{% badge text="注意" variant="caution" /%}
50-
{% badge text="危险" variant="danger" /%}
46+
- {% badge text="注释" variant="note" /%}
47+
- {% badge text="成功" variant="success" /%}
48+
- {% badge text="提示" variant="tip" /%}
49+
- {% badge text="注意" variant="caution" /%}
50+
- {% badge text="危险" variant="danger" /%}
5151
```
5252

5353
</Fragment>
5454

5555
<Fragment slot="preview">
56-
<Badge text="注释" variant="note" />
57-
<Badge text="成功" variant="success" />
58-
<Badge text="提示" variant="tip" />
59-
<Badge text="注意" variant="caution" />
60-
<Badge text="危险" variant="danger" />
56+
- <Badge text="注释" variant="note" />
57+
- <Badge text="成功" variant="success" />
58+
- <Badge text="提示" variant="tip" />
59+
- <Badge text="注意" variant="caution" />
60+
- <Badge text="危险" variant="danger" />
6161
</Fragment>
6262

6363
</Preview>
@@ -71,25 +71,25 @@ import { Badge } from '@astrojs/starlight/components';
7171
```mdx /size="\w+"/
7272
import { Badge } from '@astrojs/starlight/components';
7373

74-
<Badge text="" size="small" />
75-
<Badge text="更新更强" size="medium" />
76-
<Badge text="更新更强更逼格" size="large" />
74+
- <Badge text="" size="small" />
75+
- <Badge text="更新更强" size="medium" />
76+
- <Badge text="更新更强更逼格" size="large" />
7777
```
7878

7979
<Fragment slot="markdoc">
8080

8181
```markdoc /size="\w+"/
82-
{% badge text="新" size="small" /%}
83-
{% badge text="更新更强" size="medium" /%}
84-
{% badge text="更新更强更逼格" size="large" /%}
82+
- {% badge text="新" size="small" /%}
83+
- {% badge text="更新更强" size="medium" /%}
84+
- {% badge text="更新更强更逼格" size="large" /%}
8585
```
8686

8787
</Fragment>
8888

8989
<Fragment slot="preview">
90-
<Badge text="" size="small" />
91-
<Badge text="更新更强" size="medium" />
92-
<Badge text="更新更强更逼格" size="large" />
90+
- <Badge text="" size="small" />
91+
- <Badge text="更新更强" size="medium" />
92+
- <Badge text="更新更强更逼格" size="large" />
9393
</Fragment>
9494

9595
</Preview>

docs/src/content/docs/zh-cn/guides/customization.mdx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,15 @@ defineConfig({
198198

199199
Starlight 内置了对通过 Starlight 集成中的 [`social`](/zh-cn/reference/configuration/#social) 选项将链接添加到网站标题的社交媒体账户的支持。
200200

201-
你可以在 [配置参考](/zh-cn/reference/configuration/#social) 中找到完整的支持链接图标列表。
202-
如果你需要支持其他服务,请在 GitHub 或 Discord 上告诉我们!
201+
`social`数组中的每个条目都必须是具有以下三个属性的对象:
203202

204-
```js {9-12}
203+
- `icon`:Starlight [内置的图标](/zh-cn/reference/icons/)之一,例如 `"github"`
204+
- `label`:链接的可访问标签,例如 `"GitHub"`
205+
- `href`: 链接的 URL,例如 `"https://github.com/withastro/starlight"`
206+
207+
以下示例添加了指向 Astro Discord 和 Starlight GitHub 仓库的链接:
208+
209+
```js {9-16}
205210
// astro.config.mjs
206211
import { defineConfig } from 'astro/config';
207212
import starlight from '@astrojs/starlight';
@@ -210,10 +215,14 @@ export default defineConfig({
210215
integrations: [
211216
starlight({
212217
title: '带有社交链接的页面',
213-
social: {
214-
discord: 'https://astro.build/chat',
215-
github: 'https://github.com/withastro/starlight',
216-
},
218+
social: [
219+
{ icon: 'discord', label: 'Discord', href: 'https://astro.build/chat' },
220+
{
221+
icon: 'github',
222+
label: 'GitHub',
223+
href: 'https://github.com/withastro/starlight',
224+
},
225+
],
217226
}),
218227
],
219228
});

docs/src/content/docs/zh-cn/reference/plugins.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,23 @@ declare namespace StarlightApp {
163163
要更新嵌套的配置值,你必须提供整个嵌套对象。
164164

165165
要扩展现有的配置选项而不是覆盖它,可以将现有值展开到新值中。
166-
在下面的例子中,通过将 `config.social` 展开到新的 `social` 对象中,向现有配置添加了一个新的 [`social`](/zh-cn/reference/configuration/#social) 媒体账号:
166+
在下面的例子中,通过将 `config.social` 展开到新的 `social` 数组中,向现有配置添加了一个新的 [`social`](/zh-cn/reference/configuration/#social) 媒体账号:
167167

168-
```ts {6-11}
168+
```ts {6-15}
169169
// plugin.ts
170170
export default {
171171
name: 'add-twitter-plugin',
172172
hooks: {
173173
'config:setup'({ config, updateConfig }) {
174174
updateConfig({
175-
social: {
175+
social: [
176176
...config.social,
177-
twitter: 'https://twitter.com/astrodotbuild',
178-
},
177+
{
178+
icon: 'twitter',
179+
label: 'Twitter',
180+
href: 'https://twitter.com/astrodotbuild',
181+
},
182+
],
179183
});
180184
},
181185
},

docs/src/content/docs/zh-cn/resources/community-content.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ import { CardGrid, LinkCard } from '@astrojs/starlight/components';
4545
title="一路开源"
4646
description="Cloudflare 是如何使用 Starlight 来升级他们的开发者文档的。"
4747
/>
48+
<LinkCard
49+
href="https://starlight-changelog.netlify.app/"
50+
title="Starlight Changelog"
51+
description="在一个精美的页面上查看 @astrojs/starlight 包的所有发布版本。"
52+
/>
4853
</CardGrid>
4954

5055
## 方案和指南

docs/src/content/docs/zh-cn/resources/plugins.mdx

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ sidebar:
5252
title="starlight-obsidian"
5353
description="将 Obsidian vaults 发布到 Starlight 网站。"
5454
/>
55-
<LinkCard
56-
href="https://astro-ghostcms.xyz/intro/starlight/install/"
57-
title="starlight-ghostcms"
58-
description="添加你的 GhostCMS 博客文章到你的 Starlight 文档。"
59-
/>
6055
<LinkCard
6156
href="https://github.com/HiDeoo/starlight-image-zoom"
6257
title="starlight-image-zoom"
@@ -132,6 +127,31 @@ sidebar:
132127
title="starlight-view-transitions"
133128
description="添加浏览器原生的跨文档视图过渡动画。"
134129
/>
130+
<LinkCard
131+
href="https://github.com/HiDeoo/starlight-auto-sidebar"
132+
title="starlight-auto-sidebar"
133+
description="调整自动生成的侧边栏组。"
134+
/>
135+
<LinkCard
136+
href="https://github.com/delucis/starlight-llms-txt"
137+
title="starlight-llms-txt"
138+
description="基于 llmstxt.org 将 llms.txt 添加到你的文档站点。"
139+
/>
140+
<LinkCard
141+
href="https://github.com/trueberryless-org/starlight-toc-overview-customizer"
142+
title="starlight-toc-overview-customizer"
143+
description="调整 Starlight的 目录,可自定义概述标题。"
144+
/>
145+
<LinkCard
146+
href="https://delucis.github.io/starlight-markdown-blocks/"
147+
title="starlight-markdown-blocks"
148+
description="扩展 Starlight 的 Markdown 旁白语法,增加自定义块类型。"
149+
/>
150+
<LinkCard
151+
href="https://github.com/WindMillCode/starlight-fullview-mode"
152+
title="starlight-fullview-mode"
153+
description="收起侧边栏,展开内容以获得全屏体验。"
154+
/>
135155
</CardGrid>
136156

137157
## 社区工具和集成

0 commit comments

Comments
 (0)