Skip to content

Commit bc16df8

Browse files
committed
Setup preliminary i18n config
1 parent e3f41da commit bc16df8

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

astro.config.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,22 @@ import vercel from "@astrojs/vercel";
88

99
// https://astro.build/config
1010
export default defineConfig({
11-
site: 'https://aptos.dev',
11+
site: "https://aptos.dev",
1212
integrations: [
1313
starlight({
1414
title: "Aptos Docs",
15+
defaultLocale: "root", // optional
16+
locales: {
17+
root: {
18+
label: "English",
19+
lang: "en", // lang is required for root locales
20+
},
21+
// Simplified Chinese docs in `src/content/docs/zh/`
22+
zh: {
23+
label: "简体中文",
24+
lang: "zh",
25+
},
26+
},
1527
social: {
1628
github: "https://github.com/aptos-labs/",
1729
},

src/content.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { docsSchema } from "@astrojs/starlight/schema";
44

55
export const collections = {
66
// TODO: Find the root of errors later
7-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
7+
88
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
99
};

src/content/docs/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ hero:
88
tagline: Everything you need to build the best-in-class Web3 developer experience.
99
image:
1010
alt: Aptos logomark
11-
light: ../../assets/aptos-logomark-light.svg
12-
dark: ../../assets/aptos-logomark-dark.svg
11+
light: ~/assets/aptos-logomark-light.svg
12+
dark: ~/assets/aptos-logomark-dark.svg
1313

1414
actions:
1515
- text: Get Started
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/zh/index.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Aptos 开发者文档
3+
description: Aptos 提供一切所需,助力打造一流的 Web3 开发者体验。
4+
template: splash
5+
hero:
6+
title: |
7+
在 Aptos 上构建 Web3 的未来
8+
tagline: 提供打造一流 Web3 开发者体验的一切所需。
9+
image:
10+
alt: Aptos 标志
11+
light: ~/assets/aptos-logomark-light.svg
12+
dark: ~/assets/aptos-logomark-dark.svg
13+
14+
actions:
15+
- text: 开始使用
16+
link: /zh/guides/example/
17+
icon: right-arrow
18+
- text: 了解更多关于 Aptos
19+
link: https://aptosfoundation.org
20+
icon: external
21+
variant: minimal
22+
---

0 commit comments

Comments
 (0)