diff options
author | jspark | 2023-08-29 05:50:32 +0900 |
---|---|---|
committer | GitHub | 2023-08-28 22:50:32 +0200 |
commit | e659097ac3c0901fda4dfe51f53469c009443f2d (patch) | |
tree | 7d99816c6d324a537bc1a08cd2dfa655eaacdc73 | |
parent | 5eb3448241875a232b4a1be006c5d2e427fdd03c (diff) | |
download | IT.starlight-e659097ac3c0901fda4dfe51f53469c009443f2d.tar.gz IT.starlight-e659097ac3c0901fda4dfe51f53469c009443f2d.tar.bz2 IT.starlight-e659097ac3c0901fda4dfe51f53469c009443f2d.zip |
i18n(ko-KR): translate `i18n.mdx` (#584)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r-- | docs/src/content/docs/ko/guides/customization.mdx | 400 | ||||
-rw-r--r-- | docs/src/content/docs/ko/guides/i18n.mdx | 218 |
2 files changed, 618 insertions, 0 deletions
diff --git a/docs/src/content/docs/ko/guides/customization.mdx b/docs/src/content/docs/ko/guides/customization.mdx new file mode 100644 index 00000000..d2ba89e4 --- /dev/null +++ b/docs/src/content/docs/ko/guides/customization.mdx @@ -0,0 +1,400 @@ +--- +title: Starlight ์ฌ์ฉ์ ์ ์ +description: ๋ก๊ณ , ์ฌ์ฉ์ ์ ์ ๊ธ๊ผด, ๋๋ฉ ํ์ด์ง ๋์์ธ ๋ฑ์ ์ฌ์ฉํ์ฌ ๋๋ง์ Starlight ์ฌ์ดํธ๋ฅผ ๋ง๋๋ ๋ฐฉ๋ฒ์ ์์๋ณด์ธ์. +--- + +import { Tabs, TabItem } from '@astrojs/starlight/components'; +import FileTree from '../../../../components/file-tree.astro'; + +Starlight๋ ํฉ๋ฆฌ์ ์ธ ๊ธฐ๋ณธ ์คํ์ผ๊ณผ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ฏ๋ก ๊ตฌ์ฑ ์์ด ๋น ๋ฅด๊ฒ ์์ํ ์ ์์ต๋๋ค. Starlight ์ฌ์ดํธ์ ๋ชจ์๊ณผ ๋๋์ ๋ณ๊ฒฝํ๋ ค๋ ๊ฒฝ์ฐ ์ด ๊ฐ์ด๋๋ฅผ ์ฐธ์กฐํ์ธ์. + +## ๋ก๊ณ ์ถ๊ฐ + +์ฌ์ดํธ ํค๋์ ๋ก๊ณ ๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ Starlight ์ฌ์ดํธ์ ๋ธ๋๋๋ฅผ ์ถ๊ฐํ๋ ๋น ๋ฅธ ๋ฐฉ๋ฒ์
๋๋ค. + +1. `src/assets/` ๋๋ ํ ๋ฆฌ์ ๋ก๊ณ ์ด๋ฏธ์ง ํ์ผ์ ์ถ๊ฐํฉ๋๋ค. + + <FileTree> + + - src/ + - assets/ + - **my-logo.svg** + - content/ + - astro.config.mjs + + </FileTree> + +2. `astro.config.mjs` ํ์ผ์ ์๋ [logo.src](/ko/reference/configuration/#logo) ์ต์
์ ๊ฐ์ผ๋ก ๋ก๊ณ ํ์ผ์ ๊ฒฝ๋ก๋ฅผ ์ถ๊ฐํ์ธ์. + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import starlight from '@astrojs/starlight'; + + export default defineConfig({ + integrations: [ + starlight({ + title: '๋ก๊ณ ๋ฅผ ์ฌ์ฉํ๋ ๋ฌธ์', + logo: { + src: './src/assets/my-logo.svg', + }, + }), + ], + }); + ``` + +๊ธฐ๋ณธ์ ์ผ๋ก ๋ก๊ณ ๋ ์ฌ์ดํธ์ `title`๊ณผ ํจ๊ป ํ์๋ฉ๋๋ค. ๋ก๊ณ ์ด๋ฏธ์ง์ ์ฌ์ดํธ ์ ๋ชฉ์ด ์ด๋ฏธ ํฌํจ๋์ด ์๋ ๊ฒฝ์ฐ, `replacementTitle` ์ต์
์ ์ค์ ํ์ฌ ์ ๋ชฉ ํ
์คํธ๋ฅผ ์๊ฐ์ ์ผ๋ก ์จ๊ธธ ์ ์์ต๋๋ค. `title` ํ
์คํธ๋ ์คํฌ๋ฆฐ ๋ฆฌ๋๋ฅผ ์ํด ๋จ์ ์๊ธฐ ๋๋ฌธ์ ํค๋๋ ์ ๊ทผ์ฑ์ด ์ ์ง๋ฉ๋๋ค. + +```js +starlight({ + title: '๋ก๊ณ ๋ฅผ ์ฌ์ฉํ๋ ๋ฌธ์', + logo: { + src: './src/assets/my-logo.svg', + replacesTitle: true, + }, +}), +``` + +### ๋ผ์ดํธ ๋ชจ๋์ ๋คํฌ ๋ชจ๋์์์ ๋ก๊ณ ๋ณํ + +๋ผ์ดํธ ๋ชจ๋์ ๋คํฌ ๋ชจ๋์์ ๋ค๋ฅธ ๋ฒ์ ์ ๋ก๊ณ ๋ฅผ ํ์ํ ์ ์์ต๋๋ค. + +1. `src/assets/`์ ๊ฐ ๋ณํ์ ๋ํ ์ด๋ฏธ์ง ํ์ผ์ ์ถ๊ฐํฉ๋๋ค. + + <FileTree> + + - src/ + - assets/ + - **light-logo.svg** + - **dark-logo.svg** + - content/ + - astro.config.mjs + + </FileTree> + +2. `astro.config.mjs` ํ์ผ์์ `src` ๋์ `light` ๋ฐ `dark` ์ต์
์ ์ ๋ฌํ์ฌ ๋ก๊ณ ๋ณํ์ ๋ํ ๊ฒฝ๋ก๋ฅผ ์ถ๊ฐํ์ธ์. + + ```js + starlight({ + title: '๋ก๊ณ ๋ฅผ ์ฌ์ฉํ๋ ๋ฌธ์', + logo: { + light: './src/assets/light-logo.svg', + dark: './src/assets/dark-logo.svg', + }, + }), + ``` + +## ํ์ด์ง ๋ ์ด์์ + +๊ธฐ๋ณธ์ ์ผ๋ก Starlight ํ์ด์ง๋ ์ ์ญ ํ์ ์ฌ์ด๋๋ฐ์ ํ์ฌ ํ์ด์ง ์ ๋ชฉ์ ๋ชฉ์ฐจ๊ฐ ์๋ ๋ ์ด์์์ ์ฌ์ฉํฉ๋๋ค. + +ํ์ด์ง frontmatter์ [`template: splash`](/ko/reference/frontmatter/#template)๋ฅผ ์ค์ ํ์ฌ ์ฌ์ด๋๋ฐ ์์ด ๋ ๋์ ํ์ด์ง ๋ ์ด์์์ ์ ์ฉํ ์ ์์ต๋๋ค. ์ด๋ ํนํ ๋๋ฉ ํ์ด์ง์ ํจ๊ณผ์ ์ด๋ฉฐ [์ด ์ฌ์ดํธ์ ํํ์ด์ง](/ko)์์ ์ค์ ๋ก ์๋ํ๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค. + +```md +--- +# src/content/docs/index.md + +title: ๋๋ฉ ํ์ด์ง +template: splash +--- +``` + +## ๋ชฉ์ฐจ + +Starlight๋ ๋
์๊ฐ ์ํ๋ ์ ๋ชฉ์ผ๋ก ์ฝ๊ฒ ์ด๋ํ ์ ์๋๋ก ๊ฐ ํ์ด์ง์ ๋ชฉ์ฐจ๋ฅผ ํ์ํฉ๋๋ค. Starlight ํตํฉ์ ํตํด ๋ชจ๋ ํ์ด์ง์ ๋ชฉ์ฐจ๋ฅผ ๋ณ๊ฒฝํ๊ฑฐ๋ ๋นํ์ฑํํ ์ ์์ต๋๋ค. ๋ํ, frontmatter๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ ํ์ด์ง๋ณ๋ก ๋ชฉ์ฐจ๋ฅผ ๋ณ๊ฒฝํ ์๋ ์์ต๋๋ค. + +๊ธฐ๋ณธ์ ์ผ๋ก `<h2>` ๋ฐ `<h3>` ์ ๋ชฉ์ด ๋ชฉ์ฐจ์ ํฌํจ๋ฉ๋๋ค. ๋ชจ๋ ํ์ด์ง์ ๋ชฉ์ฐจ๋ฅผ ๋ณ๊ฒฝํ๋ ค๋ฉด [`tableOfContents`](/ko/reference/configuration/#tableofcontents) ์ `minHeadingLevel` ๋ฐ `maxHeadingLevel` ์ต์
์ ์ฌ์ฉํ์ธ์. ๊ฐ๋ณ ํ์ด์ง์ ๊ธฐ๋ณธ ๋ชฉ์ฐจ๋ฅผ ๋ณ๊ฒฝํ๊ธฐ ์ํด์๋ [frontmatter์ `tableOfContents`](/ko/reference/frontmatter/#tableofcontents) ์์ฑ์ ์ถ๊ฐํ์ธ์. + +<Tabs> + <TabItem label="๊ฐ๋ณ ํ์ด์ง ์ค์ "> + +```md +--- +# src/content/docs/example.md +title: ๋ชฉ์ฐจ์ H2๋ง ์๋ ํ์ด์ง +tableOfContents: + minHeadingLevel: 2 + maxHeadingLevel: 2 +--- +``` + + </TabItem> + <TabItem label="์ ์ญ ์ค์ "> + +```js +// astro.config.mjs + +defineConfig({ + integrations: [ + starlight({ + title: '', + tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 2 }, + }), + ], +}); +``` + + </TabItem> +</Tabs> + +`tableOfContents` ์ต์
์ ๊ฐ์ `false`๋ก ์ค์ ํ์ฌ ๋ชจ๋ ํ์ด์ง์ ๋ชฉ์ฐจ๋ฅผ ๋นํ์ฑํ ํ ์ ์์ต๋๋ค. + +<Tabs> + <TabItem label="๊ฐ๋ณ ํ์ด์ง ์ค์ "> + +```md +--- +# src/content/docs/example.md +title: ๋ชฉ์ฐจ๊ฐ ์๋ ํ์ด์ง +tableOfContents: false +--- +``` + + </TabItem> + <TabItem label="์ ์ญ ์ค์ "> + +```js +// astro.config.mjs + +defineConfig({ + integrations: [ + starlight({ + title: '๋ชจ๋ ๋ชฉ์ฐจ๊ฐ ๋นํ์ฑํ๋ ๋ฌธ์', + tableOfContents: false, + }), + ], +}); +``` + + </TabItem> +</Tabs> + +## ์์
๋งํฌ + +Starlight์๋ Starlight ํตํฉ์ [`social`](/ko/reference/configuration/#social) ์ต์
์ ํตํด ์ฌ์ดํธ ํค๋์ ์์
๋ฏธ๋์ด ๊ณ์ ์ ๋งํฌํ๋ ๊ธฐ๋ฅ์ด ๋ด์ฅ๋์ด ์์ต๋๋ค. + +ํ์ฌ Bitbucket, Codeberg, CodePen, Discord, GitHub, GitLab, Gitter, Instagram, LinkedIn, Mastodon, Microsoft Teams, Threads, Twitch, Twitter ๋ฐ Youtube์ ๋ํ ๋งํฌ๊ฐ ์ง์๋ฉ๋๋ค. ๋ค๋ฅธ ์๋น์ค์ ๋ํ ์ง์์ด ํ์ํ๋ฉด GitHub๋ Discord๋ฅผ ํตํด ์๋ ค์ฃผ์ธ์! + +```js +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +export default defineConfig({ + integrations: [ + starlight({ + title: '์์
๋งํฌ๋ฅผ ์ฌ์ฉํ๋ ๋ฌธ์', + social: { + discord: 'https://astro.build/chat', + github: 'https://github.com/withastro/starlight', + }, + }), + ], +}); +``` + +## ๋งํฌ ํธ์ง + +Starlight๋ ๊ฐ ํ์ด์ง์ ์๋์ "ํ์ด์ง ํธ์ง" ๋งํฌ๋ฅผ ํ์ํ ์ ์์ต๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ๋
์๊ฐ ๋ฌธ์ ๊ฐ์ ์ ์ํด ํธ์งํ ํ์ผ์ ์ฝ๊ฒ ์ฐพ์ ์ ์์ต๋๋ค. ํนํ ์คํ ์์ค ํ๋ก์ ํธ์ ๊ฒฝ์ฐ ์ด๋ ์ปค๋ฎค๋ํฐ์ ๊ธฐ์ฌ๋ฅผ ์ฅ๋ คํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค. + +ํธ์ง ๋งํฌ๋ฅผ ํ์ฑํํ๋ ค๋ฉด [`editLink.baseUrl`](/ko/reference/configuration/#editlink)๋ฅผ Starlight ํตํฉ ๊ตฌ์ฑ์์ ์ ์ฅ์๋ฅผ ํธ์งํ๋ ๋ฐ ์ฌ์ฉ๋๋ URL๋ก ์ค์ ํ์ธ์. `editLink.baseUrl` ๊ฐ์ ์ ์ฒด ํธ์ง ๋งํฌ๋ฅผ ํ์ฑํ๊ธฐ ์ํด ํ์ฌ ํ์ด์ง์ ๊ฒฝ๋ก ์์ ์ถ๊ฐ๋ฉ๋๋ค. + +์ผ๋ฐ์ ์ธ ํจํด์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. + +- GitHub: `https://github.com/USER_NAME/REPO_NAME/edit/BRANCH_NAME/` +- GitLab: `https://gitlab.com/USER_NAME/REPO_NAME/-/edit/BRANCH_NAME/` + +Starlight ํ๋ก์ ํธ๊ฐ ์ ์ฅ์์ ๋ฃจํธ์ ์๋ ๊ฒฝ์ฐ ๊ธฐ๋ณธ URL ๋์ ํ๋ก์ ํธ ๊ฒฝ๋ก๋ฅผ ํฌํจํฉ๋๋ค. + +์ด ์์์๋ GitHub์ `withastro/starlight` ์ ์ฅ์์ `main` ๋ธ๋์น์ ์๋ `docs/` ํ์ ๋๋ ํ ๋ฆฌ์ ์๋ Starlight ๋ฌธ์์ ๋ํด ๊ตฌ์ฑ๋ ํธ์ง ๋งํฌ๋ฅผ ๋ณด์ฌ์ค๋๋ค. + +```js +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +export default defineConfig({ + integrations: [ + starlight({ + title: 'ํธ์ง ๋งํฌ๊ฐ ์๋ ๋ฌธ์', + editLink: { + baseUrl: 'https://github.com/withastro/starlight/edit/main/docs/', + }, + }), + ], +}); +``` + +## ์ฌ์ฉ์ ์ ์ 404 ํ์ด์ง + +Starlight ์ฌ์ดํธ๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ๋จํ 404 ํ์ด์ง๋ฅผ ํ์ํฉ๋๋ค. `src/content/docs/` ๋๋ ํ ๋ฆฌ์ `404.md`(๋๋ `404.mdx`) ํ์ผ์ ์ถ๊ฐํ์ฌ ์ด๋ฅผ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค: + +<FileTree> + +- src/ + - content/ + - docs/ + - **404.md** + - index.md +- astro.config.mjs + +</FileTree> + +404 ํ์ด์ง์์ Starlight์ ๋ชจ๋ ํ์ด์ง ๋ ์ด์์๊ณผ ์ฌ์ฉ์ ์ ์ ๊ธฐ์ ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ๊ธฐ๋ณธ 404 ํ์ด์ง๋ frontmatter์์ [`splash` ํ
ํ๋ฆฟ](#ํ์ด์ง-๋ ์ด์์)๊ณผ [`hero`](/ko/reference/frontmatter/#hero) ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ฉํฉ๋๋ค. + +````md +```md +--- +title: '404' +template: splash +editUrl: false +hero: + title: '404' + tagline: ํ์ด์ง๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. URL์ ํ์ธํ๊ฑฐ๋ ๊ฒ์์ฐฝ์ ์ฌ์ฉํด ๋ณด์ธ์. +--- +``` +```` + +## ์ฌ์ฉ์ ์ ์ ๊ธ๊ผด + +๊ธฐ๋ณธ์ ์ผ๋ก Starlight๋ ๋ชจ๋ ํ
์คํธ์ ๋ํด ์ฌ์ฉ์์ ๋ก์ปฌ ์ฅ์น์์ ์ฌ์ฉํ ์ ์๋ sans-serif ๊ธ๊ผด์ ์ฌ์ฉํฉ๋๋ค. ์ด๋ฅผ ํตํด ๋์ฉ๋ ๊ธ๊ผด ํ์ผ์ ๋ค์ด๋ก๋ํ๊ธฐ ์ํ ์ถ๊ฐ ๋์ญํญ ์์ด ๊ฐ ์ฌ์ฉ์์๊ฒ ์น์ํ ๊ธ๊ผด๋ก ๋ฌธ์๋ฅผ ๋น ๋ฅด๊ฒ ๋ก๋ํ ์ ์์ต๋๋ค. + +Starlight ์ฌ์ดํธ์ ์ฌ์ฉ์ ์ ์ ๊ธ๊ผด์ ์ถ๊ฐํด์ผ ํ๋ ๊ฒฝ์ฐ, ์ฌ์ฉ์ ์ ์ CSS ํ์ผ์ด๋ ๋ค๋ฅธ [Astro ์คํ์ผ๋ง ๊ธฐ์ ](https://docs.astro.build/ko/guides/styling/)์ ์ด์ฉํด ๊ธ๊ผด์ ์ค์ ํ ์ ์์ต๋๋ค. + +### ๊ธ๊ผด ์ค์ + +์ด๋ฏธ ๊ธ๊ผด ํ์ผ์ด ์๋ ๊ฒฝ์ฐ [๋ก์ปฌ ์ค์ ๊ฐ์ด๋](#๋ก์ปฌ-๊ธ๊ผด-ํ์ผ-์ค์ )๋ฅผ ๋ฐ๋ฅด์ธ์. Google Fonts๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด [Fontsource ์ค์ ๊ฐ์ด๋](#fontsource-๊ธ๊ผด-์ค์ )๋ฅผ ๋ฐ๋ฅด์ธ์. + +#### ๋ก์ปฌ ๊ธ๊ผด ํ์ผ ์ค์ + +1. `src/fonts/` ๋๋ ํ ๋ฆฌ์ ๊ธ๊ผด ํ์ผ์ ์ถ๊ฐํ๊ณ ๋น `font-face.css` ํ์ผ์ ๋ง๋์ธ์. + + <FileTree> + + - src/ + - content/ + - fonts/ + - **CustomFont.woff2** + - **font-face.css** + - astro.config.mjs + + </FileTree> + +2. `src/fonts/font-face.css`์ ๊ฐ ๊ธ๊ผด์ ๋ํ [`@font-face` ์ ์ธ](https://developer.mozilla.org/ko/docs/Web/CSS/@font-face)์ ์ถ๊ฐํ์ธ์. `url()` ํจ์์์ ๊ธ๊ผด ํ์ผ์ ์๋ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ์ธ์. + + ```css + /* src/fonts/font-face.css */ + + @font-face { + font-family: 'Custom Font'; + /* `url()`์์ ๋ก์ปฌ ๊ธ๊ผด ํ์ผ์ ์๋ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ์ธ์. */ + src: url('./CustomFont.woff2') format('woff2'); + font-weight: normal; + font-style: normal; + font-display: swap; + } + ``` + +3. `astro.config.mjs`์ ์๋ Starlight์ `customCss` ๋ฐฐ์ด์ `font-face.css` ํ์ผ์ ๊ฒฝ๋ก๋ฅผ ์ถ๊ฐํ์ธ์. + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import starlight from '@astrojs/starlight'; + + export default defineConfig({ + integrations: [ + starlight({ + title: '์ฌ์ฉ์ ์ ์ ๊ธ๊ผด์ ์ฌ์ฉํ๋ ๋ฌธ์', + customCss: [ + // @font-face CSS ํ์ผ์ ์๋ ๊ฒฝ๋ก์
๋๋ค. + './src/fonts/font-face.css', + ], + }), + ], + }); + ``` + +#### Fontsource ๊ธ๊ผด ์ค์ + +[Fontsource](https://fontsource.org/) ํ๋ก์ ํธ๋ Google Fonts ๋ฐ ๊ธฐํ ์คํ ์์ค ๊ธ๊ผด ์ฌ์ฉ์ ๋จ์ํํฉ๋๋ค. ์ฌ์ฉํ๋ ค๋ ๊ธ๊ผด์ ์ค์นํ ์ ์๋ npm ๋ชจ๋๊ณผ ํ๋ก์ ํธ์ ์ถ๊ฐํ CSS ํ์ผ์ ์ ๊ณตํฉ๋๋ค. + +1. [Fontsource ์นดํ๋ก๊ทธ](https://fontsource.org/)์์ ์ฌ์ฉํ๋ ค๋ ๊ธ๊ผด์ ์ฐพ์ผ์ธ์. ์ด ์์์๋ [IBM Plex Serif](https://fontsource.org/fonts/ibm-plex-serif)๋ฅผ ์ฌ์ฉํฉ๋๋ค. + +2. ์ ํํ ๊ธ๊ผด์ ๋ํ ํจํค์ง๋ฅผ ์ค์นํฉ๋๋ค. Fontsource ๊ธ๊ผด ํ์ด์ง์์ โInstallโ์ ํด๋ฆญํ๋ฉด ํจํค์ง ์ด๋ฆ์ ์ฐพ์ ์ ์์ต๋๋ค. + + <Tabs> + + <TabItem label="npm"> + + ```sh + npm install @fontsource/ibm-plex-serif + ``` + + </TabItem> + + <TabItem label="pnpm"> + + ```sh + pnpm install @fontsource/ibm-plex-serif + ``` + + </TabItem> + + <TabItem label="Yarn"> + + ```sh + yarn add @fontsource/ibm-plex-serif + ``` + + </TabItem> + + </Tabs> + +3. `astro.config.mjs`์ ์๋ Starlight์ `customCss` ๋ฐฐ์ด์ Fontsource CSS ํ์ผ์ ์ถ๊ฐํฉ๋๋ค. + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import starlight from '@astrojs/starlight'; + + export default defineConfig({ + integrations: [ + starlight({ + title: '์ฌ์ฉ์ ์ ์ ๊ธ๊ผด์ ์ฌ์ฉํ๋ ๋ฌธ์', + customCss: [ + // ๋ณดํต ๋ฐ ์ฝ๊ฐ ๊ตต์ ๊ธ๊ผด ๋๊ป์ ๋ํ Fontsource ํ์ผ์
๋๋ค. + '@fontsource/ibm-plex-serif/400.css', + '@fontsource/ibm-plex-serif/600.css', + ], + }), + ], + }); + ``` + + Fontsource๋ ๊ฐ ๊ธ๊ผด์ ๋ํด ์ฌ๋ฌ CSS ํ์ผ์ ์ ๊ณตํฉ๋๋ค. ๋ค๋ฅธ ๊ตต๊ธฐ ๋ฐ ์คํ์ผ์ ํฌํจํ๋ ๋ฐฉ๋ฒ์ด ๊ถ๊ธํ๋ค๋ฉด [Fontsource ๋ฌธ์](https://fontsource.org/docs/getting-started/install#4-weights-and-styles)๋ฅผ ์ฐธ์กฐํ์ธ์. + +### ๊ธ๊ผด ์ฌ์ฉ + +์ค์ ํ ๊ธ๊ผด์ ์ฌ์ดํธ์ ์ ์ฉํ๋ ค๋ฉด [์ฌ์ฉ์ ์ ์ CSS ํ์ผ](/ko/guides/css-and-tailwind/#custom-css-styles)์์ ์ ํํ ๊ธ๊ผด ์ด๋ฆ์ ์ฌ์ฉํ์ธ์. ์๋ฅผ ๋ค์ด Starlight์ ๊ธฐ๋ณธ ๊ธ๊ผด์ ๋ณ๊ฒฝํ๋ ค๋ฉด ์ฌ์ฉ์ ์ ์ ์์ฑ์ธ `--sl-font`๋ฅผ ์ค์ ํ์ธ์. + +```css +/* src/styles/custom.css */ + +:root { + --sl-font: 'IBM Plex Serif', serif; +} +``` + +๊ธ๊ผด์ ๋ ์ ํ์ ์ผ๋ก ์ ์ฉํ๋ ค๋ฉด ๋ ๋ง์ ํ๊ฒ CSS๋ฅผ ์์ฑํ ์๋ ์์ต๋๋ค. +์๋ฅผ ๋ค์ด ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ๋ฉ์ธ ์ฝํ
์ธ ์๋ง ๊ธ๊ผด์ ์ค์ ํ๊ณ ์ฌ์ด๋๋ฐ์๋ ๊ธ๊ผด์ ์ค์ ํ์ง ์์ ์ ์์ต๋๋ค. + +```css +/* src/styles/custom.css */ + +main { + font-family: 'IBM Plex Serif', serif; +} +``` + +[์ฌ์ฉ์ ์ ์ CSS ์ฌ์ฉ๋ฒ](/ko/guides/css-and-tailwind/#์ฌ์ฉ์-์ ์-css-์คํ์ผ)์ ๋ฐ๋ผ ์ฌ์ดํธ์ ์คํ์ผ์ ์ถ๊ฐํ์ธ์. diff --git a/docs/src/content/docs/ko/guides/i18n.mdx b/docs/src/content/docs/ko/guides/i18n.mdx new file mode 100644 index 00000000..4c7c4826 --- /dev/null +++ b/docs/src/content/docs/ko/guides/i18n.mdx @@ -0,0 +1,218 @@ +--- +title: ๊ตญ์ ํ (i18n) +description: ์ฌ๋ฌ ์ธ์ด๋ฅผ ์ง์ํ๋๋ก Starlight ์ฌ์ดํธ๋ฅผ ๊ตฌ์ฑํ๋ ๋ฐฉ๋ฒ์ ์์๋ณด์ธ์. +--- + +import FileTree from '../../../../components/file-tree.astro'; + +Starlight๋ ๋ผ์ฐํ
, ๋์ฒด ์ฝํ
์ธ ๋ฐ ์ ์ฒด RTL(์ค๋ฅธ์ชฝ์์ ์ผ์ชฝ์ผ๋ก) ์ธ์ด ์ง์์ ํฌํจํ์ฌ ๋ค๊ตญ์ด ์ฌ์ดํธ์ ๋ํ ๊ธฐ๋ณธ ์ง์์ ์ ๊ณตํฉ๋๋ค. + +## i18n ๊ตฌ์ฑ + +1. Starlight ํตํฉ์ [`locales`](/ko/reference/configuration/#locales) ๋ฐ [`defaultLocale`](/ko/reference/configuration/#defaultlocale)์ ์ ๋ฌํ์ฌ ์ฌ์ดํธ๊ฐ ์ง์ํด์ผ ํ ์ธ์ด์ ๋ํด ์๋ ค์ฃผ์ธ์. + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import starlight from '@astrojs/starlight'; + + export default defineConfig({ + integrations: [ + starlight({ + title: '๋์ ๋ฌธ์', + // ์ฌ์ดํธ์ ๊ธฐ๋ณธ ์ธ์ด๋ฅผ ์์ด๋ก ์ค์ ํฉ๋๋ค. + defaultLocale: 'en', + locales: { + // ์์ด ๋ฌธ์๋ `src/content/docs/en/`์ ์์ต๋๋ค. + en: { + label: 'English', + }, + // ์ค๊ตญ์ด ๊ฐ์ฒด ๋ฌธ์๋ `src/content/docs/zh/`์ ์์ต๋๋ค. + zh: { + label: '็ฎไฝไธญๆ', + lang: 'zh-CN', + }, + // ์๋์ด ๋ฌธ์๋ `src/content/docs/ar/`์ ์์ต๋๋ค. + ar: { + label: 'ุงูุนุฑุจูุฉ', + dir: 'rtl', + }, + }, + }), + ], + }); + ``` + + `defaultLocale`์ ๋์ฒด ์ฝํ
์ธ ๋ฐ UI ๋ผ๋ฒจ์ ์ฌ์ฉ๋๋ฏ๋ก ์ฝํ
์ธ ์์ฑ์ ์์ํ ๊ฐ๋ฅ์ฑ์ด ๊ฐ์ฅ ๋๊ฑฐ๋ ์ด๋ฏธ ์ฝํ
์ธ ๊ฐ ์๋ ์ธ์ด๋ก ์ ํํ์ธ์. + +2. `src/content/docs/`์ ๊ฐ ์ธ์ด์ ๋ํ ๋๋ ํ ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค. ์๋ฅผ ๋ค์ด ์์์ ์ฌ์ฉํ ๊ตฌ์ฑ์ ๊ฒฝ์ฐ ๋ค์๊ณผ ๊ฐ์ด ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค. + + <FileTree> + + - src/ + - content/ + - docs/ + - ar/ + - en/ + - zh/ + + </FileTree> + +3. ์ด์ ์ธ์ด ๋๋ ํ ๋ฆฌ์ ์ฝํ
์ธ ํ์ผ์ ์ถ๊ฐํ ์ ์์ต๋๋ค. ์ฌ๋ฌ ์ธ์ด๋ก ์์ฑ๋ ํ์ด์ง๋ฅผ ์ฐ๊ฒฐํ๊ธฐ ์ํด ๊ฐ์ ์ด๋ฆ์ ํ์ผ์ ์ฌ์ฉํ๋ฉด Starlight์ ๋ชจ๋ i18n ๊ธฐ๋ฅ(๋์ฒด ์ฝํ
์ธ , ๋ฒ์ญ ์๋ฆผ ๋ฑ)์ ํ์ฉํ ์ ์์ต๋๋ค. + + ์๋ฅผ ๋ค์ด, ์๋์ด์ ์์ด ํํ์ด์ง๋ฅผ ๊ฐ๊ฐ ๋ํ๋ด๋ ค๋ฉด `ar/index.md` ๋ฐ `en/index.md`๋ฅผ ๋ง๋ญ๋๋ค. + +### ๋ฃจํธ ๋ก์ผ์ผ ์ฌ์ฉ + +๊ฒฝ๋ก์ i18n ์ ๋์ฌ๊ฐ ์๋ ์ธ์ด๋ฅผ ์ ๊ณตํ๋ ค๋ฉด "๋ฃจํธ" ๋ก์ผ์ผ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ์์ด๊ฐ ๋ฃจํธ ๋ก์ผ์ผ์ธ ๊ฒฝ์ฐ ์์ด ํ์ด์ง ๊ฒฝ๋ก๋ `/en/about` ๋์ `/about`๊ฐ ๋ฉ๋๋ค. + +๋ฃจํธ ๋ก์ผ์ผ์ ์ค์ ํ๋ ค๋ฉด `locales` ๊ตฌ์ฑ์์ `root` ํค๋ฅผ ์ฌ์ฉํ์ธ์. ๋ฃจํธ ๋ก์ผ์ผ์ด ์ฝํ
์ธ ์ ๊ธฐ๋ณธ ๋ก์ผ์ผ์ด๊ธฐ๋ ํ ๊ฒฝ์ฐ `defaultLocale`์ ์ ๊ฑฐํ๊ฑฐ๋ ๊ฐ์ `root`๋ก ์ค์ ํ์ธ์. + +```js +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +export default defineConfig({ + integrations: [ + starlight({ + title: '๋์ ๋ฌธ์', + defaultLocale: 'root', // ์ ํ์ + locales: { + root: { + label: 'English', + lang: 'en', // ๋ฃจํธ ๋ก์ผ์ผ์ lang์ด ๋ฐ๋์ ํ์ํฉ๋๋ค. + }, + zh: { + label: '็ฎไฝไธญๆ', + lang: 'zh-CN', + }, + }, + }), + ], +}); +``` + +๋ฃจํธ ๋ก์ผ์ผ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ํด๋น ์ธ์ด๋ก ์์ฑ๋ ํ์ด์ง๋ฅผ ์ ์ฉ ์ธ์ด ํด๋ ๋์ `src/content/docs/`์ ์ง์ ๋ณด๊ดํ์ธ์. ์๋ฅผ ๋ค์ด ์ ๊ตฌ์ฑ์ ์ฌ์ฉํ ๋ ์์ด์ ์ค๊ตญ์ด์ ๋ํ ํ ํ์ด์ง ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. + +<FileTree> + +- src/ + - content/ + - docs/ + - **index.md** + - zh/ + - **index.md** + +</FileTree> + +#### ๋จ์ผ ์ธ์ด๋ฅผ ์ฌ์ฉํ๋ ์ฌ์ดํธ + +๊ธฐ๋ณธ์ ์ผ๋ก Starlight๋ ๋จ์ผ ์ธ์ด(์์ด) ์ฌ์ดํธ์
๋๋ค. +๋ค๋ฅธ ์ธ์ด๋ก ๋จ์ผ ์ธ์ด ์ฌ์ดํธ๋ฅผ ๋ง๋ค๋ ค๋ฉด `locales` ๊ตฌ์ฑ์์ `root`๋ฅผ ํด๋น ์ธ์ด๋ก ์ค์ ํ์ธ์. + +```js +// astro.config.mjs +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +export default defineConfig({ + integrations: [ + starlight({ + title: '๋์ ๋ฌธ์', + locales: { + root: { + label: 'ํ๊ตญ์ด', + lang: 'ko', + }, + }, + }), + ], +}); +``` + +์ด๋ฅผ ํตํด ์ธ์ด ์ ํ๊ธฐ์ ๊ฐ์ ๋ค๊ตญ์ด ์ฌ์ดํธ์ ๋ํ ๋ค๋ฅธ ๊ตญ์ ํ ๊ธฐ๋ฅ์ ํ์ฑํํ์ง ์๊ณ ๋ Starlight์ ๊ธฐ๋ณธ ์ธ์ด๋ฅผ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค. + +## ๋์ฒด ์ฝํ
์ธ + +Starlight๋ ๊ทํ๊ฐ ๋ชจ๋ ์ธ์ด๋ก ๊ฐ์ ํ์ด์ง๋ฅผ ์์ฑํ ๊ฒ์ ๊ธฐ๋ํฉ๋๋ค. ์๋ฅผ ๋ค์ด `en/about.md` ํ์ผ์ด ์๋ ๊ฒฝ์ฐ ์ง์ํ๋ ๊ฐ ์ธ์ด์ ๋ํด `about.md`๋ฅผ ๋ง๋ญ๋๋ค. ์ด๋ฅผ ํตํด Starlight๋ ์์ง ๋ฒ์ญ๋์ง ์์ ํ์ด์ง์ ์๋ ๋์ฒด ์ฝํ
์ธ ๋ฅผ ์ ๊ณตํฉ๋๋ค. + +ํน์ ์ธ์ด์ ๋ํ ๋ฒ์ญ์ด ์์ง ์ ๊ณต๋์ง ์๋ ๊ฒฝ์ฐ Starlight๋ ๋
์์๊ฒ ํด๋น ํ์ด์ง์ ์ฝํ
์ธ ๋ฅผ ๊ธฐ๋ณธ ์ธ์ด(`defaultLocale`์ ํตํด ์ค์ ๋ ์ธ์ด)๋ก ํ์ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, About ํ์ด์ง์ ํ๋์ค์ด ๋ฒ์ ์ ์์ง ๋ง๋ค์ง ์์๊ณ ๊ธฐ๋ณธ ์ธ์ด๊ฐ ์์ด์ธ ๊ฒฝ์ฐ `/fr/about`์ ๋ฐฉ๋ฌธํ ๋
์๋ ์ด ํ์ด์ง๊ฐ ์์ง ๋ฒ์ญ๋์ง ์์๋ค๋ ์๋ฆผ๊ณผ ํจ๊ป `/en/about`์ ์๋ ์์ด ์ฝํ
์ธ ๋ฅผ ๋ณด๊ฒ ๋ฉ๋๋ค. ์ด๋ฅผ ํตํด ๊ธฐ๋ณธ ์ธ์ด๋ก ์ฝํ
์ธ ๋ฅผ ์ถ๊ฐํ ๋ค์ ์ ์ง์ ์ผ๋ก ๋ฒ์ญํ ์ ์์ต๋๋ค. + +## Starlight UI ๋ฒ์ญ + +๋ฒ์ญ๋ ์ฝํ
์ธ ํ์ผ์ ํธ์คํ
ํ๋ ๊ฒ ์ธ์๋ Starlight๋ฅผ ์ฌ์ฉํ๋ฉด ๋
์๊ฐ ์ ํํ ์ธ์ด๋ก ์ฌ์ดํธ ์ ์ฒด๋ฅผ ๊ฒฝํํ ์ ์๋๋ก ๊ธฐ๋ณธ UI ๋ฌธ์์ด(์๋ฅผ ๋ค์ด, ์ค๋ฅธ์ชฝ ๋ชฉ์ฐจ์ ์ ๋ชฉ์ธ "๋ชฉ์ฐจ")๋ฅผ ๋ฒ์ญํ ์ ์์ต๋๋ค. + +์์ด, ์ฒด์ฝ์ด, ํ๋์ค์ด, ๋
์ผ์ด, ์ดํ๋ฆฌ์์ด, ์ผ๋ณธ์ด, ํฌ๋ฅดํฌ๊ฐ์ด, ๋ค๋๋๋์ด, ๋ด๋งํฌ์ด, ์คํ์ธ์ด, ํฐํค์ด, ์๋์ด, ๋
ธ๋ฅด์จ์ด์ด, ํ๋ฅด์์์ด, ์ค๊ตญ์ด ๊ฐ์ฒด, ํ๊ตญ์ด ๋ฐ ์ค์จ๋ด์ด๋ก ๋ฒ์ญ๋ UI ๋ฌธ์์ด์ด ๊ธฐ๋ณธ์ ์ผ๋ก ์ ๊ณต๋ฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ฐ๋ฆฌ๋ [๋ ๋ง์ ๊ธฐ๋ณธ ์ธ์ด๋ฅผ ์ถ๊ฐํ๋ ๋ฐ ๊ธฐ์ฌ](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md)ํ๋๊ฑธ ํ์ํฉ๋๋ค. + +`i18n` ๋ฐ์ดํฐ ์ปฌ๋ ์
์ ํตํด ์ง์ํ๋ ์ถ๊ฐ ์ธ์ด์ ๋ํ ๋ฒ์ญ์ ์ ๊ณตํ๊ฑฐ๋ ๊ธฐ๋ณธ ๋ผ๋ฒจ์ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค. + +1. ์์ง ๊ตฌ์ฑ๋์ง ์์ ๊ฒฝ์ฐ `src/content/config.ts`์์ `i18n` ๋ฐ์ดํฐ ์ปฌ๋ ์
์ ๊ตฌ์ฑํฉ๋๋ค. + + ```js + // src/content/config.ts + import { defineCollection } from 'astro:content'; + import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'; + + export const collections = { + docs: defineCollection({ schema: docsSchema() }), + i18n: defineCollection({ type: 'data', schema: i18nSchema() }), + }; + ``` + +2. `src/content/i18n/`์ UI ๋ฒ์ญ ๋ฌธ์์ด์ ์ ๊ณตํ๋ ค๋ ๊ฐ ์ถ๊ฐ ์ธ์ด์ ๋ํ JSON ํ์ผ์ ๋ง๋ญ๋๋ค. ์๋ฅผ ๋ค์ด ๋ค์์ ์๋์ด ๋ฐ ์ค๊ตญ์ด ๊ฐ์ฒด์ ๋ํ ๋ฒ์ญ ํ์ผ์ ์ถ๊ฐํฉ๋๋ค. + + <FileTree> + + - src/ + - content/ + - i18n/ + - ar.json + - zh-CN.json + + </FileTree> + +3. JSON ํ์ผ์์ ๋ฒ์ญํ ํค์ ๋ํ ๋ฒ์ญ์ ์ถ๊ฐํฉ๋๋ค. ํค๋ ์์ด๋ก ๋จ๊ฒจ๋๊ณ ๊ฐ์ ๋ฒ์ญํด์ผํฉ๋๋ค. (์: `"search.label": "Buscar"`) + + Starlight์ ํจ๊ป ์ ๊ณต๋๋ ๊ธฐ์กด ๋ฌธ์์ด์ ์์ด ๊ธฐ๋ณธ๊ฐ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. + + ```json + { + "skipLink.label": "Skip to content", + "search.label": "Search", + "search.shortcutLabel": "(Press / to Search)", + "search.cancelLabel": "Cancel", + "search.devWarning": "Search is only available in production builds. \nTry building and previewing the site to test it out locally.", + "themeSelect.accessibleLabel": "Select theme", + "themeSelect.dark": "Dark", + "themeSelect.light": "Light", + "themeSelect.auto": "Auto", + "languageSelect.accessibleLabel": "Select language", + "menuButton.accessibleLabel": "Menu", + "sidebarNav.accessibleLabel": "Main", + "tableOfContents.onThisPage": "On this page", + "tableOfContents.overview": "Overview", + "i18n.untranslatedContent": "This content is not available in your language yet.", + "page.editLink": "Edit page", + "page.lastUpdated": "Last updated:", + "page.previousLink": "Next", + "page.nextLink": "Previous" + } + ``` + + Starlight์ ๊ฒ์ ๋ชจ๋ฌ์ [Pagefind](https://pagefind.app/) ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ํด ๊ตฌ๋๋ฉ๋๋ค. ๋์ผํ JSON ํ์ผ์์ `pagefind` ํค๋ฅผ ์ฌ์ฉํ์ฌ Pagefind์ UI์ ๋ํ ๋ฒ์ญ์ ์ค์ ํ ์ ์์ต๋๋ค. + + ```json + { + "pagefind.clear_search": "Clear", + "pagefind.load_more": "Load more results", + "pagefind.search_label": "Search this site", + "pagefind.filters_label": "Filters", + "pagefind.zero_results": "No results for [SEARCH_TERM]", + "pagefind.many_results": "[COUNT] results for [SEARCH_TERM]", + "pagefind.one_result": "[COUNT] result for [SEARCH_TERM]", + "pagefind.alt_search": "No results for [SEARCH_TERM]. Showing results for [DIFFERENT_TERM] instead", + "pagefind.search_suggestion": "No results for [SEARCH_TERM]. Try one of the following searches:", + "pagefind.searching": "Searching for [SEARCH_TERM]..." + } + ``` |