diff options
author | Js Park | 2023-12-06 18:17:13 +0900 |
---|---|---|
committer | GitHub | 2023-12-06 10:17:13 +0100 |
commit | cac1ea7067acb6ee3ae7ab45a5f9d704bcaae9b5 (patch) | |
tree | cb970e576b5f176b817fed6a2a020e59abc8ed1a | |
parent | 29eb251de07202824f1578931388327856bce5e6 (diff) | |
download | IT.starlight-cac1ea7067acb6ee3ae7ab45a5f9d704bcaae9b5.tar.gz IT.starlight-cac1ea7067acb6ee3ae7ab45a5f9d704bcaae9b5.tar.bz2 IT.starlight-cac1ea7067acb6ee3ae7ab45a5f9d704bcaae9b5.zip |
i18n(ko-KR): add `site-search.mdx` (#1233)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
-rw-r--r-- | docs/src/content/docs/ko/guides/site-search.mdx | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/docs/src/content/docs/ko/guides/site-search.mdx b/docs/src/content/docs/ko/guides/site-search.mdx new file mode 100644 index 00000000..d3a64f55 --- /dev/null +++ b/docs/src/content/docs/ko/guides/site-search.mdx @@ -0,0 +1,166 @@ +--- +title: ์ฌ์ดํธ ๊ฒ์ +description: Starlight์ ๋ด์ฅ๋ ์ฌ์ดํธ ๊ฒ์ ๊ธฐ๋ฅ๊ณผ ์ด๋ฅผ ์ฌ์ฉ์ ์ ์ํ๋ ๋ฐฉ๋ฒ์ ๋ํด ์์๋ณด์ธ์. +sidebar: + badge: New +--- + +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +๊ธฐ๋ณธ์ ์ผ๋ก Starlight ์ฌ์ดํธ์๋ ์ ์ ์ฌ์ดํธ๋ฅผ ์ํ ๋น ๋ฅด๊ณ ๋ฎ์ ๋์ญํญ์ ๊ฐ์ถ ๊ฒ์ ๋๊ตฌ์ธ [Pagefind](https://pagefind.app/)์์ ์ ๊ณตํ๋ ์ ์ฒด ํ
์คํธ ๊ฒ์์ด ํฌํจ๋์ด ์์ต๋๋ค. + +๊ฒ์์ ํ์ฑํํ๋ ๋ฐ ๊ตฌ์ฑ์ด ํ์ํ์ง ์์ต๋๋ค. ์ฌ์ดํธ๋ฅผ ๊ตฌ์ถํ๊ณ ๋ฐฐํฌํ ๋ค์, ์ฌ์ดํธ ํค๋์ ๊ฒ์์ฐฝ์ ์ฌ์ฉํ์ฌ ์ฝํ
์ธ ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. + +## ๊ฒ์๊ฒฐ๊ณผ์์ ์ฝํ
์ธ ์จ๊ธฐ๊ธฐ + +### ํ์ด์ง ์ ์ธ + +๊ฒ์ ์์ธ์์ ํ์ด์ง๋ฅผ ์ ์ธํ๋ ค๋ฉด ํ์ด์ง ํ๋ฐํธ๋งคํฐ์ [`pagefind: false`](/ko/reference/frontmatter/#pagefind)๋ฅผ ์ถ๊ฐํ์ธ์. + +```md title="src/content/docs/not-indexed.md" ins={3} +--- +title: ๊ฒ์์์ ์จ๊ธธ ์ฝํ
์ธ +pagefind: false +--- +``` + +### ํ์ด์ง ์ผ๋ถ ์ ์ธ + +Pagefind๋ [`data-pagefind-ignore`](https://pagefind.app/docs/indexing/#removing-individual-elements-from-the-index) ์์ฑ์ด ์๋ ์์ ๋ด๋ถ์ ์ฝํ
์ธ ๋ฅผ ๋ฌด์ํฉ๋๋ค. + +๋ค์ ์์์์ ์ฒซ ๋ฒ์งธ ๋จ๋ฝ์ ๊ฒ์ ๊ฒฐ๊ณผ์ ํ์๋์ง๋ง `<div>`์ ๋ด์ฉ์ ํ์๋์ง ์์ต๋๋ค. + +```md title="src/content/docs/partially-indexed.md" ins="data-pagefind-ignore" +--- +title: ๋ถ๋ถ์ ์ผ๋ก ์์ธ์ด ์์ฑ๋ ํ์ด์ง +--- + +์ด ํ
์คํธ๋ ๊ฒ์์ ํตํด ์ฐพ์ ์ ์์ต๋๋ค. + +<div data-pagefind-ignore> + +์ด ํ
์คํธ๋ ๊ฒ์์์ ์จ๊ฒจ์ง๋๋ค. + +</div> +``` + +## ๋์ฒด ๊ฒ์ ๊ณต๊ธ์ + +### Algolia DocSearch + +[Algolia์ DocSearch ํ๋ก๊ทธ๋จ](https://docsearch.algolia.com/)์ ๋ํ ์ก์ธ์ค ๊ถํ์ด ์๊ณ , ์ด๋ฅผ Pagefind ๋์ ์ฌ์ฉํ๋ ค๋ ๊ฒฝ์ฐ, ๊ณต์ Starlight DocSearch ํ๋ฌ๊ทธ์ธ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. + +1. `@astrojs/starlight-docsearch`๋ฅผ ์ค์นํฉ๋๋ค. + + <Tabs> + + <TabItem label="npm"> + + ```sh + npm install @astrojs/starlight-docsearch + ``` + + </TabItem> + + <TabItem label="pnpm"> + + ```sh + pnpm install @astrojs/starlight-docsearch + ``` + + </TabItem> + + <TabItem label="Yarn"> + + ```sh + yarn add @astrojs/starlight-docsearch + ``` + + </TabItem> + + </Tabs> + +2. `astro.config.mjs` ํ์ผ์ Starlight [`plugins`](/ko/reference/configuration/#plugins) ๊ตฌ์ฑ์ DocSearch๋ฅผ ์ถ๊ฐํ๊ณ Algolia `appId`, `apiKey`, `indexName`๋ฅผ ์ ๋ฌํฉ๋๋ค. + + ```js ins={4,10-16} + // astro.config.mjs + import { defineConfig } from 'astro/config'; + import starlight from '@astrojs/starlight'; + import starlightDocSearch from '@astrojs/starlight-docsearch'; + + export default defineConfig({ + integrations: [ + starlight({ + title: 'DocSearch๋ฅผ ์ฌ์ฉํ๋ ์ฌ์ดํธ', + plugins: [ + starlightDocSearch({ + appId: 'YOUR_APP_ID', + apiKey: 'YOUR_SEARCH_API_KEY', + indexName: 'YOUR_INDEX_NAME', + }), + ], + }), + ], + }); + ``` + +์ด ์
๋ฐ์ดํธ๋ ๊ตฌ์ฑ์ ์ฌ์ฉํ๋ฉด ์ฌ์ดํธ์ ๊ฒ์ ์ฐฝ์์ ๊ธฐ๋ณธ ๊ฒ์ ๋ชจ๋ฌ ๋์ Algolia ๋ชจ๋ฌ์ด ์ด๋ฆฝ๋๋ค. + +#### DocSearch UI ๋ฒ์ญ + +DocSearch๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์์ด UI ๋ฌธ์์ด๋ง ์ ๊ณตํฉ๋๋ค. +Starlight์ ๋ด์ฅ๋ [๊ตญ์ ํ ์์คํ
](/ko/guides/i18n/#starlight-ui-๋ฒ์ญ)์ ์ฌ์ฉํ์ฌ ๋ชจ๋ฌ UI ๋ฒ์ญ์ ์ถ๊ฐํ์ธ์. + +1. `src/content/config.ts` ํ์ผ์ DocSearch ์คํค๋ง๋ฅผ ์ฌ์ฉํ์ฌ Starlight์ `i18n` ์ฝํ
์ธ ์ปฌ๋ ์
์ ์๋ฅผ ํ์ฅํฉ๋๋ค. + + ```js ins={4} ins=/{ extend: .+ }/ + // src/content/config.ts + import { defineCollection } from 'astro:content'; + import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'; + import { docSearchI18nSchema } from '@astrojs/starlight-docsearch/schema'; + + export const collections = { + docs: defineCollection({ schema: docsSchema() }), + i18n: defineCollection({ + type: 'data', + schema: i18nSchema({ extend: docSearchI18nSchema() }), + }), + }; + ``` + +2. `src/content/i18n/` ๋๋ ํฐ๋ฆฌ์ ์๋ JSON ํ์ผ์ ๋ฒ์ญ์ ์ถ๊ฐํ์ธ์. + + DocSearch์์ ์ฌ์ฉ๋๋ ์์ด ๊ธฐ๋ณธ๊ฐ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. + + ```json title="src/content/i18n/en.json" + { + "docsearch.searchBox.resetButtonTitle": "Clear the query", + "docsearch.searchBox.resetButtonAriaLabel": "Clear the query", + "docsearch.searchBox.cancelButtonText": "Cancel", + "docsearch.searchBox.cancelButtonAriaLabel": "Cancel", + + "docsearch.startScreen.recentSearchesTitle": "Recent", + "docsearch.startScreen.noRecentSearchesText": "No recent searches", + "docsearch.startScreen.saveRecentSearchButtonTitle": "Save this search", + "docsearch.startScreen.removeRecentSearchButtonTitle": "Remove this search from history", + "docsearch.startScreen.favoriteSearchesTitle": "Favorite", + "docsearch.startScreen.removeFavoriteSearchButtonTitle": "Remove this search from favorites", + + "docsearch.errorScreen.titleText": "Unable to fetch results", + "docsearch.errorScreen.helpText": "You might want to check your network connection.", + + "docsearch.footer.selectText": "to select", + "docsearch.footer.selectKeyAriaLabel": "Enter key", + "docsearch.footer.navigateText": "to navigate", + "docsearch.footer.navigateUpKeyAriaLabel": "Arrow up", + "docsearch.footer.navigateDownKeyAriaLabel": "Arrow down", + "docsearch.footer.closeText": "to close", + "docsearch.footer.closeKeyAriaLabel": "Escape key", + "docsearch.footer.searchByText": "Search by", + + "docsearch.noResultsScreen.noResultsText": "No results for", + "docsearch.noResultsScreen.suggestedQueryText": "Try searching for", + "docsearch.noResultsScreen.reportMissingResultsText": "Believe this query should return results?", + "docsearch.noResultsScreen.reportMissingResultsLinkText": "Let us know." + } + ``` |