跳到主要内容

将首页汉化为中文

最后更新于:

将首页汉化为中文

编辑src\content\docs\index.mdx文件:

默认英文

 1
 2---
 3title: Welcome to Starlight
 4description: Get started building your docs site with Starlight.
 5template: splash # Remove or comment out this line to display the site sidebar on this page.
 6hero:
 7  tagline: Congrats on setting up a new Starlight project!
 8  image:
 9    file: ../../assets/houston.webp
10  actions:
11    - text: Example Guide
12      link: /guides/example/
13      icon: right-arrow
14    - text: Read the Starlight docs
15      link: https://starlight.astro.build
16      icon: external
17      variant: minimal
18---
19
20import { Card, CardGrid } from '@astrojs/starlight/components';
21
22## Next steps
23
24<CardGrid stagger>
25	<Card title="Update content" icon="pencil">
26		Edit `src/content/docs/index.mdx` to see this page change.
27	</Card>
28	<Card title="Change page layout" icon="document">
29		Delete `template: splash` in `src/content/docs/index.mdx` to display a
30		sidebar on this page.
31	</Card>
32	<Card title="Add new content" icon="add-document">
33		Add Markdown or MDX files to `src/content/docs` to create new pages.
34	</Card>
35	<Card title="Configure your site" icon="setting">
36		Edit your `sidebar` and other config in `astro.config.mjs`.
37	</Card>
38	<Card title="Read the docs" icon="open-book">
39		Learn more in [the Starlight Docs](https://starlight.astro.build/).
40	</Card>
41</CardGrid>

汉化为中文

 1
 2---
 3title: 欢迎使用 Starlight
 4description: 快速开始使用 Starlight 构建你的文档网站。
 5template: splash
 6hero:
 7  tagline: 恭喜你成功搭建了一个全新的 Starlight 项目!
 8  image:
 9    file: ../../assets/houston.webp
10  actions:
11    - text: 示例指南
12      link: /guides/example/
13      icon: right-arrow
14    - text: 阅读 Starlight 文档
15      link: https://starlight.astro.build/zh/
16      icon: external
17      variant: minimal
18---
19
20import { Card, CardGrid } from '@astrojs/starlight/components';
21
22## 下一步操作
23
24<CardGrid stagger>
25	<Card title="更新内容" icon="pencil">
26		编辑 `src/content/docs/index.mdx` 来修改此页面。
27	</Card>
28	<Card title="更改页面布局" icon="document">
29		删除页面中的 `template: splash` 即可显示侧边栏。
30	</Card>
31	<Card title="添加新内容" icon="add-document">
32`src/content/docs` 中添加 Markdown 或 MDX 文件创建新页面。
33	</Card>
34	<Card title="配置站点" icon="setting">
35`astro.config.mjs` 中编辑侧边栏与其他配置。
36	</Card>
37	<Card title="阅读文档" icon="open-book">
38		在 [Starlight 中文文档](sslocal://flow/file_open?url=https%3A%2F%2Fstarlight.astro.build%2Fzh%2F&flow_extra=eyJsaW5rX3R5cGUiOiJjb2RlX2ludGVycHJldGVyIn0=) 中了解更多。
39	</Card>
40</CardGrid>
最新文章

文档导航