config.ts 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. import { createRequire } from 'module'
  2. import { defineAdditionalConfig, type DefaultTheme } from 'vitepress'
  3. const require = createRequire(import.meta.url)
  4. const pkg = require('vitepress/package.json')
  5. export default defineAdditionalConfig({
  6. lang: 'ko-KR',
  7. description: 'Vite 및 Vue 기반 정적 사이트 생성기.',
  8. themeConfig: {
  9. nav: nav(),
  10. search: { options: searchOptions() },
  11. sidebar: {
  12. '/ko/guide/': { base: '/ko/guide/', items: sidebarGuide() },
  13. '/ko/reference/': { base: '/ko/reference/', items: sidebarReference() }
  14. },
  15. editLink: {
  16. pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
  17. text: '이 페이지 편집 제안하기'
  18. },
  19. footer: {
  20. message: 'Released under the MIT License.',
  21. copyright: 'Copyright © 2019-present Evan You'
  22. },
  23. docFooter: {
  24. prev: '이전',
  25. next: '다음'
  26. },
  27. outline: {
  28. label: '이 페이지 목차'
  29. },
  30. lastUpdated: {
  31. text: '업데이트 날짜'
  32. },
  33. notFound: {
  34. title: '페이지를 찾을 수 없습니다',
  35. quote:
  36. '방향을 바꾸지 않고 계속 찾다 보면 결국 당신이 가고 있는 곳에 도달할 수도 있습니다.',
  37. linkLabel: '홈으로 가기',
  38. linkText: '집으로 데려가줘'
  39. },
  40. langMenuLabel: '언어 변경',
  41. returnToTopLabel: '맨 위로 돌아가기',
  42. sidebarMenuLabel: '사이드바 메뉴',
  43. darkModeSwitchLabel: '다크 모드',
  44. lightModeSwitchTitle: '라이트 모드로 변경',
  45. darkModeSwitchTitle: '다크 모드로 변경',
  46. skipToContentLabel: '본문으로 건너뛰기'
  47. }
  48. })
  49. function nav(): DefaultTheme.NavItem[] {
  50. return [
  51. {
  52. text: '가이드',
  53. link: '/ko/guide/what-is-vitepress',
  54. activeMatch: '/ko/guide/'
  55. },
  56. {
  57. text: '레퍼런스',
  58. link: '/ko/reference/site-config',
  59. activeMatch: '/ko/reference/'
  60. },
  61. {
  62. text: pkg.version,
  63. items: [
  64. {
  65. text: '변경 로그',
  66. link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
  67. },
  68. {
  69. text: '기여',
  70. link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md'
  71. }
  72. ]
  73. }
  74. ]
  75. }
  76. function sidebarGuide(): DefaultTheme.SidebarItem[] {
  77. return [
  78. {
  79. text: '소개',
  80. collapsed: false,
  81. items: [
  82. {
  83. text: 'VitePress란 무엇인가?',
  84. link: 'what-is-vitepress'
  85. },
  86. {
  87. text: '시작하기',
  88. link: 'getting-started'
  89. },
  90. {
  91. text: '라우팅',
  92. link: 'routing'
  93. },
  94. {
  95. text: '배포하기',
  96. link: 'deploy'
  97. }
  98. ]
  99. },
  100. {
  101. text: '글쓰기',
  102. collapsed: false,
  103. items: [
  104. {
  105. text: '마크다운 확장 기능',
  106. link: 'markdown'
  107. },
  108. {
  109. text: '에셋 핸들링',
  110. link: 'asset-handling'
  111. },
  112. {
  113. text: '전문(Front-matter)',
  114. link: 'frontmatter'
  115. },
  116. {
  117. text: '마크다운에서 Vue 사용하기',
  118. link: 'using-vue'
  119. },
  120. {
  121. text: 'i18n',
  122. link: 'i18n'
  123. }
  124. ]
  125. },
  126. {
  127. text: '커스텀',
  128. collapsed: false,
  129. items: [
  130. {
  131. text: '커스텀 테마 사용하기',
  132. link: 'custom-theme'
  133. },
  134. {
  135. text: '기본 테마 확장하기',
  136. link: 'extending-default-theme'
  137. },
  138. {
  139. text: '빌드할 때 데이터 로딩하기',
  140. link: 'data-loading'
  141. },
  142. {
  143. text: 'SSR 호환성',
  144. link: 'ssr-compat'
  145. },
  146. {
  147. text: 'CMS 연결하기',
  148. link: 'cms'
  149. }
  150. ]
  151. },
  152. {
  153. text: '실험적인',
  154. collapsed: false,
  155. items: [
  156. {
  157. text: 'MPA 모드',
  158. link: 'mpa-mode'
  159. },
  160. {
  161. text: '사이트맵 생성',
  162. link: 'sitemap-generation'
  163. }
  164. ]
  165. },
  166. {
  167. text: '구성 & API 레퍼런스',
  168. base: '/ko/reference/',
  169. link: 'site-config'
  170. }
  171. ]
  172. }
  173. function sidebarReference(): DefaultTheme.SidebarItem[] {
  174. return [
  175. {
  176. text: '레퍼런스',
  177. items: [
  178. { text: '사이트 구성', link: 'site-config' },
  179. { text: '전문(front-matter) 구성', link: 'frontmatter-config' },
  180. { text: '런타임 API', link: 'runtime-api' },
  181. { text: 'CLI', link: 'cli' },
  182. {
  183. text: '기본 테마',
  184. base: '/ko/reference/default-theme-',
  185. items: [
  186. { text: '개요', link: 'config' },
  187. { text: '네비게이션 바', link: 'nav' },
  188. { text: '사이드바', link: 'sidebar' },
  189. { text: '홈 페이지', link: 'home-page' },
  190. { text: '푸터', link: 'footer' },
  191. { text: '레이아웃', link: 'layout' },
  192. { text: '배지(badge)', link: 'badge' },
  193. { text: '팀 페이지', link: 'team-page' },
  194. { text: '이전/다음 링크', link: 'prev-next-links' },
  195. { text: '편집 링크', link: 'edit-link' },
  196. { text: '마지막 업데이트 날짜', link: 'last-updated' },
  197. { text: '검색', link: 'search' },
  198. { text: '카본 광고', link: 'carbon-ads' }
  199. ]
  200. }
  201. ]
  202. }
  203. ]
  204. }
  205. function searchOptions(): Partial<DefaultTheme.AlgoliaSearchOptions> {
  206. return {
  207. placeholder: '문서 검색',
  208. translations: {
  209. button: {
  210. buttonText: '검색',
  211. buttonAriaLabel: '검색'
  212. },
  213. modal: {
  214. searchBox: {
  215. resetButtonTitle: '검색 지우기',
  216. resetButtonAriaLabel: '검색 지우기',
  217. cancelButtonText: '취소',
  218. cancelButtonAriaLabel: '취소'
  219. },
  220. startScreen: {
  221. recentSearchesTitle: '검색 기록',
  222. noRecentSearchesText: '최근 검색 없음',
  223. saveRecentSearchButtonTitle: '검색 기록에 저장',
  224. removeRecentSearchButtonTitle: '검색 기록에서 삭제',
  225. favoriteSearchesTitle: '즐겨찾기',
  226. removeFavoriteSearchButtonTitle: '즐겨찾기에서 삭제'
  227. },
  228. errorScreen: {
  229. titleText: '결과를 가져올 수 없습니다',
  230. helpText: '네트워크 연결을 확인하세요'
  231. },
  232. footer: {
  233. selectText: '선택',
  234. navigateText: '탐색',
  235. closeText: '닫기',
  236. searchByText: '검색 기준'
  237. },
  238. noResultsScreen: {
  239. noResultsText: '결과를 찾을 수 없습니다',
  240. suggestedQueryText: '새로운 검색을 시도할 수 있습니다',
  241. reportMissingResultsText: '해당 검색어에 대한 결과가 있어야 합니까?',
  242. reportMissingResultsLinkText: '피드백 보내기 클릭'
  243. }
  244. }
  245. }
  246. }
  247. }