diff options
author | Junseong Park | 2025-07-17 16:21:47 +0900 |
---|---|---|
committer | GitHub | 2025-07-17 09:21:47 +0200 |
commit | e327fa03240b33750b0fa502f844ed790737a508 (patch) | |
tree | 0599f4338c3d2b4f4278093d2f14bf32ae10f971 | |
parent | 4963afb526ecedc08865d177539ac8f05d3f54e7 (diff) | |
download | IT.starlight-e327fa03240b33750b0fa502f844ed790737a508.tar.gz IT.starlight-e327fa03240b33750b0fa502f844ed790737a508.tar.bz2 IT.starlight-e327fa03240b33750b0fa502f844ed790737a508.zip |
i18n(ko-KR): update `manual-setup.mdx`, `configuration.mdx` (#3322)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
-rw-r--r-- | docs/src/content/docs/ko/manual-setup.mdx | 2 | ||||
-rw-r--r-- | docs/src/content/docs/ko/reference/configuration.mdx | 120 |
2 files changed, 120 insertions, 2 deletions
diff --git a/docs/src/content/docs/ko/manual-setup.mdx b/docs/src/content/docs/ko/manual-setup.mdx index 280090d0..bebae1ba 100644 --- a/docs/src/content/docs/ko/manual-setup.mdx +++ b/docs/src/content/docs/ko/manual-setup.mdx @@ -63,7 +63,7 @@ export default defineConfig({ Starlight๋ `src/content.config.ts` ํ์ผ์ ๊ตฌ์ฑ๋ Astro์ [์ฝํ
์ธ ์ปฌ๋ ์
](https://docs.astro.build/ko/guides/content-collections/) ์์ ๊ตฌ์ถ๋์์ต๋๋ค. -Starlight์ `docsLoader` ๋ฐ `docsSchema`๋ฅผ ์ฌ์ฉํ๋ `docs` ์ปฌ๋ ์
์ ์ถ๊ฐํ์ฌ ์ฝํ
์ธ ๊ตฌ์ฑ ํ์ผ์ ์์ฑํ๊ฑฐ๋ ์
๋ฐ์ดํธํ์ธ์. +Starlight์ [`docsLoader`](/ko/reference/configuration/#docsloader) ๋ฐ [`docsSchema`](/ko/reference/configuration/#docsschema)๋ฅผ ์ฌ์ฉํ๋ `docs` ์ปฌ๋ ์
์ ์ถ๊ฐํ์ฌ ์ฝํ
์ธ ๊ตฌ์ฑ ํ์ผ์ ์์ฑํ๊ฑฐ๋ ์
๋ฐ์ดํธํ์ธ์. ```js ins={3-4,7} // src/content.config.ts diff --git a/docs/src/content/docs/ko/reference/configuration.mdx b/docs/src/content/docs/ko/reference/configuration.mdx index df71387d..50ab2715 100644 --- a/docs/src/content/docs/ko/reference/configuration.mdx +++ b/docs/src/content/docs/ko/reference/configuration.mdx @@ -223,7 +223,11 @@ type SidebarItem = | { // ์๋์ผ๋ก ์์ฑ๋ ๋งํฌ ๊ทธ๋ฃน label: string; - autogenerate: { directory: string; collapsed?: boolean }; + autogenerate: { + directory: string; + collapsed?: boolean; + attrs?: Record<string, string | number | boolean | undefined>; + }; collapsed?: boolean; } )); @@ -677,3 +681,117 @@ starlight({ credits: true, }); ``` + +## ์ฝํ
์ธ ์ปฌ๋ ์
๊ตฌ์ฑ + +Starlight๋ Astro์ [์ฝํ
์ธ ์ปฌ๋ ์
](https://docs.astro.build/ko/guides/content-collections/)์ ์ฌ์ฉํ์ฌ ์ฝํ
์ธ ๋ฅผ ๋ก๋ํฉ๋๋ค. +Starlight์ ์ฝํ
์ธ ๋ก๋ ๋ฐ ์คํค๋ง๋ ํ์์ ๋ฐ๋ผ ์ปฌ๋ ์
์ ๊ตฌ์ฑํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. + +```js +// src/content.config.ts +import { defineCollection } from 'astro:content'; +import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders'; +import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), + // ์ ํ ์ฌํญ: i18n ์ปฌ๋ ์
์ ๋ค๊ตญ์ด ์ฌ์ดํธ์ UI ๋ฒ์ญ์ ์ฌ์ฉ๋ฉ๋๋ค. + i18n: defineCollection({ loader: i18nLoader(), schema: i18nSchema() }), +}; +``` + +### ๋ก๋ + +Starlight๋ ์ฝํ
์ธ ์ปฌ๋ ์
๊ตฌ์ฑ์ ๊ฐ์ํํ๊ธฐ ์ํด `@astrojs/starlight/loaders` ๋ชจ๋์์ ๋ค์๊ณผ ๊ฐ์ [Astro ๋ก๋](https://docs.astro.build/ko/reference/content-loader-reference/)๋ฅผ ๋ด๋ณด๋
๋๋ค. + +#### `docsLoader()` + +`docsLoader()`๋ `src/content/docs/` ๋๋ ํฐ๋ฆฌ์์ ๋ก์ปฌ Markdown, MDX ๋ฐ Markdoc ํ์ผ์ ๋ก๋ํฉ๋๋ค. +๋ฐ์ค (`_`)๋ก ์์ํ๋ ํ์ผ ์ด๋ฆ์ ๋ฌด์๋ฉ๋๋ค. + +##### ๊ฐ์ ธ์ค๊ธฐ + +```js +import { docsLoader } from '@astrojs/starlight/loaders'; +``` + +##### ์ต์
+ +###### `generateId()` + +**ํ์
:** `({ entry: string; base: URL; data: Record<string, unknown> }) => string` + +๊ธฐ๋ณธ์ ์ผ๋ก `docsLoader()`๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ๋ ํ์ด์ง๋ ํน์ ๋ฌธ์๋ฅผ ์ ๊ฑฐํ๊ณ ํ์ผ ์ด๋ฆ์ ์๋ฌธ์๋ก ์ฒ๋ฆฌํ๋ sluggifier๋ฅผ ์ฌ์ฉํ์ฌ ํ์ผ ์ด๋ฆ์ ์ฒ๋ฆฌํฉ๋๋ค. ์ด ๊ธฐ๋ณธ ๋์์ ์ฌ์ ์ํ๋ ค๋ฉด ์ฌ์ฉ์ ์ ์ `generateId()` ํจ์๋ฅผ ์ ๊ณตํ์ธ์. + +์๋ฅผ ๋ค์ด, ์ด๋ ์ ๊ฑฐ๋ ํน์ ๋ฌธ์๋ฅผ ๋ณด์กดํ๋ ๋ฐ ์ ์ฉํ ์ ์์ต๋๋ค. +๊ธฐ๋ณธ์ ์ผ๋ก `Example.File.md`๋ `/examplefile`์์ ์ ๊ณต๋ฉ๋๋ค. +์ด๋ฅผ `/Example.File`์์ ์ ๊ณตํ๋ ค๋ฉด ์ฌ์ฉ์ ์ ์ `generateId()` ํจ์๋ฅผ ์ ์ํ๋ฉด ๋ฉ๋๋ค. + +```js +docsLoader({ + // `.md` ๋๋ `.mdx` ํ์ฅ์๋ฅผ ์ ๊ฑฐํ๋, ํ์ผ ์ด๋ฆ์ ๊ทธ๋๋ก ์ ์งํฉ๋๋ค. + generateId: ({ entry }) => entry.split('.').slice(0, -1).join('.'), +}), +``` + +์์ธํ ๋ด์ฉ์ [Astro ๋ฌธ์์์ `generateId()`](https://docs.astro.build/ko/reference/content-loader-reference/#generateid)๋ฅผ ์ฐธ์กฐํ์ธ์. + +#### `i18nLoader()` + +`i18nLoader()`๋ `src/content/i18n/` ๋๋ ํฐ๋ฆฌ์์ ๋ก์ปฌ JSON ๋ฐ YAML ํ์ผ์ ๋ก๋ํฉ๋๋ค. +๋ฐ์ค (`_`)๋ก ์์ํ๋ ํ์ผ ์ด๋ฆ์ ๋ฌด์๋ฉ๋๋ค. + +##### ๊ฐ์ ธ์ค๊ธฐ + +```js +import { i18nLoader } from '@astrojs/starlight/loaders'; +``` + +##### ์ต์
+ +ํ์ฌ `i18nLoader()`๋ฅผ ๊ตฌ์ฑํ๋ ์ต์
์ ์์ต๋๋ค. + +### ์คํค๋ง + +Starlight๋ `@astrojs/starlight/schema` ๋ชจ๋์์ ๋ค์๊ณผ ๊ฐ์ [์ฝํ
์ธ ์ปฌ๋ ์
์คํค๋ง](https://docs.astro.build/ko/guides/content-collections/#์ปฌ๋ ์
-์คํค๋ง-์ ์)๋ฅผ ์ ๊ณตํฉ๋๋ค. +์ด๋ฌํ ์คํค๋ง๋ Starlight๊ฐ ์์กดํ๋ `docs` ๋ฐ `i18n` ์ปฌ๋ ์
์ ์ฌ์ฉํด์ผ ํฉ๋๋ค. + +#### `docsSchema()` + +`docsSchema()`๋ `docs` ์ปฌ๋ ์
์ ๋ชจ๋ ์ฝํ
์ธ ์ ๋ํ ํ๋ฐํธ๋งคํฐ๋ฅผ ๊ตฌ๋ฌธ ๋ถ์ํฉ๋๋ค. + +##### ๊ฐ์ ธ์ค๊ธฐ + +```js +import { docsSchema } from '@astrojs/starlight/schema'; +``` + +##### ์ต์
+ +###### `extend` + +**ํ์
:** Zod ์คํค๋ง ๋๋ Zod ์คํค๋ง๋ฅผ ๋ฐํํ๋ ํจ์ +**๊ธฐ๋ณธ๊ฐ:** `z.object({})` + +์ถ๊ฐ ํ๋๋ฅผ ์ฌ์ฉํ์ฌ Starlight์ ํ๋ฐํธ๋งคํฐ ์คํค๋ง๋ฅผ ํ์ฅํฉ๋๋ค. +`extend` ์ต์
์ฌ์ฉ์ ๋ํ ์์ธํ ๋ด์ฉ์ ["ํ๋ฐํธ๋งคํฐ ์คํค๋ง ์ฌ์ฉ์ ์ ์"](/ko/reference/frontmatter/#ํ๋ฐํธ๋งคํฐ-์คํค๋ง-์ฌ์ฉ์-์ ์)๋ฅผ ์ฐธ์กฐํ์ธ์. + +#### `i18nSchema()` + +`i18nSchema()`๋ `i18n` ์ปฌ๋ ์
์ ๋ชจ๋ ๋ฐ์ดํฐ ํ์ผ์ ๊ตฌ๋ฌธ ๋ถ์ํฉ๋๋ค. + +##### ๊ฐ์ ธ์ค๊ธฐ + +```js +import { i18nSchema } from '@astrojs/starlight/schema'; +``` + +##### ์ต์
+ +###### `extend` + +**ํ์
:** Zod ๊ฐ์ฒด +**๊ธฐ๋ณธ๊ฐ:** `z.object({})` + +์ถ๊ฐ ํ๋๋ฅผ ์ฌ์ฉํ์ฌ Starlight์ i18n ์คํค๋ง๋ฅผ ํ์ฅํฉ๋๋ค. +`extend` ์ต์
์ฌ์ฉ์ ๋ํ ์์ธํ ๋ด์ฉ์ ["๋ฒ์ญ ์คํค๋ง ํ์ฅํ๊ธฐ"](/ko/guides/i18n/#๋ฒ์ญ-์คํค๋ง-ํ์ฅ)๋ฅผ ์ฐธ์กฐํ์ธ์. |