config.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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: 'es-CO',
  7. description: 'Generador de Sitios Estaticos desarrollado con Vite y Vue.',
  8. themeConfig: {
  9. nav: nav(),
  10. search: { options: searchOptions() },
  11. sidebar: {
  12. '/es/guide/': { base: '/es/guide/', items: sidebarGuide() },
  13. '/es/reference/': { base: '/es/reference/', items: sidebarReference() }
  14. },
  15. editLink: {
  16. pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
  17. text: 'Editar esta página en GitHub'
  18. },
  19. footer: {
  20. message: 'Liberado bajo la licencia MIT',
  21. copyright: `Derechos reservados © 2019-${new Date().getFullYear()} Evan You`
  22. },
  23. docFooter: {
  24. prev: 'Anterior',
  25. next: 'Siguiente'
  26. },
  27. outline: {
  28. label: 'En esta página'
  29. },
  30. lastUpdated: {
  31. text: 'Actualizado en'
  32. },
  33. notFound: {
  34. title: 'PÁGINA NO ENCONTRADA',
  35. quote:
  36. 'Pero si no cambias de dirección y sigues buscando, podrías terminar donde te diriges.',
  37. linkLabel: 'ir a inicio',
  38. linkText: 'Llévame a casa'
  39. },
  40. langMenuLabel: 'Cambiar Idioma',
  41. returnToTopLabel: 'Volver arriba',
  42. sidebarMenuLabel: 'Menu Lateral',
  43. darkModeSwitchLabel: 'Tema Oscuro',
  44. lightModeSwitchTitle: 'Cambiar a modo claro',
  45. darkModeSwitchTitle: 'Cambiar a modo oscuro',
  46. skipToContentLabel: 'Saltar al contenido'
  47. }
  48. })
  49. function nav(): DefaultTheme.NavItem[] {
  50. return [
  51. {
  52. text: 'Guia',
  53. link: '/es/guide/what-is-vitepress',
  54. activeMatch: '/es/guide/'
  55. },
  56. {
  57. text: 'Referencia',
  58. link: '/es/reference/site-config',
  59. activeMatch: '/es/reference/'
  60. },
  61. {
  62. text: pkg.version,
  63. items: [
  64. {
  65. text: 'Registro de cambios',
  66. link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
  67. },
  68. {
  69. text: 'Contribuir',
  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: 'Introducción',
  80. collapsed: false,
  81. items: [
  82. { text: 'Qué es VitePress?', link: 'what-is-vitepress' },
  83. { text: 'Iniciando', link: 'getting-started' },
  84. { text: 'Enrutamiento', link: 'routing' },
  85. { text: 'Despliegue', link: 'deploy' }
  86. ]
  87. },
  88. {
  89. text: 'Escribiendo',
  90. collapsed: false,
  91. items: [
  92. { text: 'Extensiones Markdown', link: 'markdown' },
  93. { text: 'Manejo de assets', link: 'asset-handling' },
  94. { text: 'Frontmatter', link: 'frontmatter' },
  95. { text: 'Usando Vue en Markdown', link: 'using-vue' },
  96. { text: 'Internacionalización', link: 'i18n' }
  97. ]
  98. },
  99. {
  100. text: 'Pesonalización',
  101. collapsed: false,
  102. items: [
  103. { text: 'Usando un tema personalizado', link: 'custom-theme' },
  104. {
  105. text: 'Extendiendo el tema por defecto',
  106. link: 'extending-default-theme'
  107. },
  108. {
  109. text: 'Carga de datos en tiempo de compilación',
  110. link: 'data-loading'
  111. },
  112. { text: 'Compatibilidad SSR', link: 'ssr-compat' },
  113. { text: 'Conectando a un CMS', link: 'cms' }
  114. ]
  115. },
  116. {
  117. text: 'Experimental',
  118. collapsed: false,
  119. items: [
  120. { text: 'Modo MPA', link: 'mpa-mode' },
  121. { text: 'Generación de Sitemap', link: 'sitemap-generation' }
  122. ]
  123. },
  124. {
  125. text: 'Configuración y Referencia del API',
  126. base: '/es/reference/',
  127. link: 'site-config'
  128. }
  129. ]
  130. }
  131. function sidebarReference(): DefaultTheme.SidebarItem[] {
  132. return [
  133. {
  134. text: 'Referencia',
  135. items: [
  136. { text: 'Configuración del sitio', link: 'site-config' },
  137. { text: 'Configuración Frontmatter', link: 'frontmatter-config' },
  138. { text: 'API de tiempo de ejecución', link: 'runtime-api' },
  139. { text: 'CLI', link: 'cli' },
  140. {
  141. text: 'Tema por defecto',
  142. base: '/es/reference/default-theme-',
  143. items: [
  144. { text: 'Visión general', link: 'config' },
  145. { text: 'Navegación', link: 'nav' },
  146. { text: 'Barra Lateral', link: 'sidebar' },
  147. { text: 'Página Inicial', link: 'home-page' },
  148. { text: 'Pie de página', link: 'footer' },
  149. { text: 'Layout', link: 'layout' },
  150. { text: 'Distintivo', link: 'badge' },
  151. { text: 'Página del equipo', link: 'team-page' },
  152. { text: 'Links Anterior / Siguiente', link: 'prev-next-links' },
  153. { text: 'Editar Link', link: 'edit-link' },
  154. { text: 'Sello temporal de actualización', link: 'last-updated' },
  155. { text: 'Busqueda', link: 'search' },
  156. { text: 'Carbon Ads', link: 'carbon-ads' }
  157. ]
  158. }
  159. ]
  160. }
  161. ]
  162. }
  163. function searchOptions(): Partial<DefaultTheme.AlgoliaSearchOptions> {
  164. return {
  165. placeholder: 'Buscar documentos',
  166. translations: {
  167. button: {
  168. buttonText: 'Buscar',
  169. buttonAriaLabel: 'Buscar'
  170. },
  171. modal: {
  172. searchBox: {
  173. resetButtonTitle: 'Limpiar búsqueda',
  174. resetButtonAriaLabel: 'Limpiar búsqueda',
  175. cancelButtonText: 'Cancelar',
  176. cancelButtonAriaLabel: 'Cancelar'
  177. },
  178. startScreen: {
  179. recentSearchesTitle: 'Historial de búsqueda',
  180. noRecentSearchesText: 'Ninguna búsqueda reciente',
  181. saveRecentSearchButtonTitle: 'Guardar en el historial de búsqueda',
  182. removeRecentSearchButtonTitle: 'Borrar del historial de búsqueda',
  183. favoriteSearchesTitle: 'Favoritos',
  184. removeFavoriteSearchButtonTitle: 'Borrar de favoritos'
  185. },
  186. errorScreen: {
  187. titleText: 'No fue posible obtener resultados',
  188. helpText: 'Verifique su conexión de red'
  189. },
  190. footer: {
  191. selectText: 'Seleccionar',
  192. navigateText: 'Navegar',
  193. closeText: 'Cerrar',
  194. searchByText: 'Busqueda por'
  195. },
  196. noResultsScreen: {
  197. noResultsText: 'No fue posible encontrar resultados',
  198. suggestedQueryText: 'Puede intentar una nueva búsqueda',
  199. reportMissingResultsText:
  200. 'Deberian haber resultados para esa consulta?',
  201. reportMissingResultsLinkText: 'Click para enviar feedback'
  202. }
  203. }
  204. }
  205. }
  206. }