Skip to content

Commit a38b0ec

Browse files
committed
Add i18n
1 parent b587b0b commit a38b0ec

File tree

13 files changed

+221
-1
lines changed

13 files changed

+221
-1
lines changed

astro.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ export default defineConfig({
99
integrations: [
1010
starlight({
1111
title: "Pixeval",
12+
defaultLocale: "zh-cn",
13+
locales: {
14+
"zh-cn": {
15+
label: "简体中文",
16+
lang: "zh-CN",
17+
},
18+
en: {
19+
label: "English",
20+
},
21+
fr: {
22+
label: "Français",
23+
},
24+
ru: {
25+
label: "Русский",
26+
},
27+
},
1228
logo: {
1329
src: "./src/assets/logo.png",
1430
},
File renamed without changes.

src/content/docs/index.mdx renamed to src/content/docs/en/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ hero:
1515
</span>
1616
tagline: Congrats on setting up a new Starlight project!
1717
image:
18-
file: ../../assets/houston.webp
18+
file: ../../../assets/houston.webp
1919
actions:
2020
- text: Example Guide
2121
link: /guides/example/
File renamed without changes.

src/content/docs/fr/guides/example.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Example Guide
3+
description: A guide in my new Starlight docs site.
4+
---
5+
6+
Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
7+
Writing a good guide requires thinking about what your users are trying to do.
8+
9+
## Further reading
10+
11+
- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework

src/content/docs/fr/index.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Welcome to Starlight
3+
description: Get started building your docs site with Starlight.
4+
template: splash
5+
hero:
6+
title: |
7+
Welcome to Starlight with
8+
<span
9+
class="font-black text-transparent
10+
bg-clip-text bg-gradient-to-b
11+
from-accent-700 to-accent-400
12+
dark:from-accent-500 dark:to-accent-200"
13+
>
14+
Tailwind
15+
</span>
16+
tagline: Congrats on setting up a new Starlight project!
17+
image:
18+
file: ../../../assets/houston.webp
19+
actions:
20+
- text: Example Guide
21+
link: /guides/example/
22+
icon: right-arrow
23+
- text: Read the Starlight docs
24+
link: https://starlight.astro.build
25+
icon: external
26+
variant: minimal
27+
---
28+
29+
import { Card, CardGrid } from '@astrojs/starlight/components';
30+
31+
## Next steps
32+
33+
<CardGrid stagger>
34+
<Card title="Update content" icon="pencil">
35+
Edit `src/content/docs/index.mdx` to see this page change.
36+
</Card>
37+
<Card title="Add new content" icon="add-document">
38+
Add Markdown or MDX files to `src/content/docs` to create new pages.
39+
</Card>
40+
<Card title="Configure your site" icon="setting">
41+
Edit your `sidebar` and other config in `astro.config.mjs`.
42+
</Card>
43+
<Card title="Read the docs" icon="open-book">
44+
Learn more in [the Starlight Docs](https://starlight.astro.build/).
45+
</Card>
46+
</CardGrid>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Example Reference
3+
description: A reference page in my new Starlight docs site.
4+
---
5+
6+
Reference pages are ideal for outlining how things work in terse and clear terms.
7+
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting.
8+
9+
## Further reading
10+
11+
- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework

src/content/docs/ru/guides/example.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Example Guide
3+
description: A guide in my new Starlight docs site.
4+
---
5+
6+
Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
7+
Writing a good guide requires thinking about what your users are trying to do.
8+
9+
## Further reading
10+
11+
- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework

src/content/docs/ru/index.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Welcome to Starlight
3+
description: Get started building your docs site with Starlight.
4+
template: splash
5+
hero:
6+
title: |
7+
Welcome to Starlight with
8+
<span
9+
class="font-black text-transparent
10+
bg-clip-text bg-gradient-to-b
11+
from-accent-700 to-accent-400
12+
dark:from-accent-500 dark:to-accent-200"
13+
>
14+
Tailwind
15+
</span>
16+
tagline: Congrats on setting up a new Starlight project!
17+
image:
18+
file: ../../../assets/houston.webp
19+
actions:
20+
- text: Example Guide
21+
link: /guides/example/
22+
icon: right-arrow
23+
- text: Read the Starlight docs
24+
link: https://starlight.astro.build
25+
icon: external
26+
variant: minimal
27+
---
28+
29+
import { Card, CardGrid } from '@astrojs/starlight/components';
30+
31+
## Next steps
32+
33+
<CardGrid stagger>
34+
<Card title="Update content" icon="pencil">
35+
Edit `src/content/docs/index.mdx` to see this page change.
36+
</Card>
37+
<Card title="Add new content" icon="add-document">
38+
Add Markdown or MDX files to `src/content/docs` to create new pages.
39+
</Card>
40+
<Card title="Configure your site" icon="setting">
41+
Edit your `sidebar` and other config in `astro.config.mjs`.
42+
</Card>
43+
<Card title="Read the docs" icon="open-book">
44+
Learn more in [the Starlight Docs](https://starlight.astro.build/).
45+
</Card>
46+
</CardGrid>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Example Reference
3+
description: A reference page in my new Starlight docs site.
4+
---
5+
6+
Reference pages are ideal for outlining how things work in terse and clear terms.
7+
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting.
8+
9+
## Further reading
10+
11+
- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework

0 commit comments

Comments
 (0)