config.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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: 'pt-BR',
  7. description: 'Gerador de Site Estático desenvolvido com Vite e Vue.',
  8. themeConfig: {
  9. nav: nav(),
  10. search: { options: searchOptions() },
  11. sidebar: {
  12. '/pt/guide/': { base: '/pt/guide/', items: sidebarGuide() },
  13. '/pt/reference/': { base: '/pt/reference/', items: sidebarReference() }
  14. },
  15. editLink: {
  16. pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
  17. text: 'Edite esta página no GitHub'
  18. },
  19. footer: {
  20. message: 'Lançado sob licença MIT',
  21. copyright: `Direitos reservados © 2019-${new Date().getFullYear()} Evan You`
  22. },
  23. docFooter: {
  24. prev: 'Anterior',
  25. next: 'Próximo'
  26. },
  27. outline: {
  28. label: 'Nesta página'
  29. },
  30. lastUpdated: {
  31. text: 'Atualizado em'
  32. },
  33. notFound: {
  34. title: 'PÁGINA NÃO ENCONTRADA',
  35. quote:
  36. 'Mas se você não mudar de direção e continuar procurando, pode acabar onde está indo.',
  37. linkLabel: 'ir para a página inicial',
  38. linkText: 'Me leve para casa'
  39. },
  40. langMenuLabel: 'Alterar Idioma',
  41. returnToTopLabel: 'Voltar ao Topo',
  42. sidebarMenuLabel: 'Menu Lateral',
  43. darkModeSwitchLabel: 'Tema Escuro',
  44. lightModeSwitchTitle: 'Mudar para Modo Claro',
  45. darkModeSwitchTitle: 'Mudar para Modo Escuro',
  46. skipToContentLabel: 'Pular para o Conteúdo'
  47. }
  48. })
  49. function nav(): DefaultTheme.NavItem[] {
  50. return [
  51. {
  52. text: 'Guia',
  53. link: '/pt/guide/what-is-vitepress',
  54. activeMatch: '/pt/guide/'
  55. },
  56. {
  57. text: 'Referência',
  58. link: '/pt/reference/site-config',
  59. activeMatch: '/pt/reference/'
  60. },
  61. {
  62. text: pkg.version,
  63. items: [
  64. {
  65. text: 'Registro de Mudanças',
  66. link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md'
  67. },
  68. {
  69. text: 'Contribuindo',
  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: 'Introdução',
  80. collapsed: false,
  81. items: [
  82. { text: 'O que é VitePress?', link: 'what-is-vitepress' },
  83. { text: 'Iniciando', link: 'getting-started' },
  84. { text: 'Roteamento', link: 'routing' },
  85. { text: 'Implantação', link: 'deploy' }
  86. ]
  87. },
  88. {
  89. text: 'Escrevendo',
  90. collapsed: false,
  91. items: [
  92. { text: 'Extensões Markdown', link: 'markdown' },
  93. { text: 'Manipulando Ativos', link: 'asset-handling' },
  94. { text: 'Frontmatter', link: 'frontmatter' },
  95. { text: 'Usando Vue em Markdown', link: 'using-vue' },
  96. { text: 'Internacionalização', link: 'i18n' }
  97. ]
  98. },
  99. {
  100. text: 'Personalização',
  101. collapsed: false,
  102. items: [
  103. { text: 'Usando um tema personalizado', link: 'custom-theme' },
  104. { text: 'Estendendo o tema padrão', link: 'extending-default-theme' },
  105. {
  106. text: 'Carregamento de dados no momento da compilação',
  107. link: 'data-loading'
  108. },
  109. { text: 'Compatibilidade SSR', link: 'ssr-compat' },
  110. { text: 'Conectando a um CMS', link: 'cms' }
  111. ]
  112. },
  113. {
  114. text: 'Experimental',
  115. collapsed: false,
  116. items: [
  117. { text: 'Modo MPA', link: 'mpa-mode' },
  118. { text: 'Geração de Sitemap', link: 'sitemap-generation' }
  119. ]
  120. },
  121. {
  122. text: 'Configuração e Referência da API',
  123. base: '/pt/reference/',
  124. link: 'site-config'
  125. }
  126. ]
  127. }
  128. function sidebarReference(): DefaultTheme.SidebarItem[] {
  129. return [
  130. {
  131. text: 'Referência',
  132. items: [
  133. { text: 'Configuração do Site', link: 'site-config' },
  134. { text: 'Configuração Frontmatter', link: 'frontmatter-config' },
  135. { text: 'API do tempo de execução', link: 'runtime-api' },
  136. { text: 'CLI', link: 'cli' },
  137. {
  138. text: 'Tema padrão',
  139. base: '/pt/reference/default-theme-',
  140. items: [
  141. { text: 'Visão Geral', link: 'config' },
  142. { text: 'Navegação', link: 'nav' },
  143. { text: 'Barra Lateral', link: 'sidebar' },
  144. { text: 'Página Inicial', link: 'home-page' },
  145. { text: 'Rodapé', link: 'footer' },
  146. { text: 'Layout', link: 'layout' },
  147. { text: 'Distintivo', link: 'badge' },
  148. { text: 'Página da Equipe', link: 'team-page' },
  149. { text: 'Links Anterior / Próximo', link: 'prev-next-links' },
  150. { text: 'Editar Link', link: 'edit-link' },
  151. { text: 'Selo Temporal de Atualização', link: 'last-updated' },
  152. { text: 'Busca', link: 'search' },
  153. { text: 'Carbon Ads', link: 'carbon-ads' }
  154. ]
  155. }
  156. ]
  157. }
  158. ]
  159. }
  160. function searchOptions(): Partial<DefaultTheme.AlgoliaSearchOptions> {
  161. return {
  162. placeholder: 'Pesquisar documentos',
  163. translations: {
  164. button: {
  165. buttonText: 'Pesquisar',
  166. buttonAriaLabel: 'Pesquisar'
  167. },
  168. modal: {
  169. searchBox: {
  170. resetButtonTitle: 'Limpar pesquisa',
  171. resetButtonAriaLabel: 'Limpar pesquisa',
  172. cancelButtonText: 'Cancelar',
  173. cancelButtonAriaLabel: 'Cancelar'
  174. },
  175. startScreen: {
  176. recentSearchesTitle: 'Histórico de Pesquisa',
  177. noRecentSearchesText: 'Nenhuma pesquisa recente',
  178. saveRecentSearchButtonTitle: 'Salvar no histórico de pesquisas',
  179. removeRecentSearchButtonTitle: 'Remover do histórico de pesquisas',
  180. favoriteSearchesTitle: 'Favoritos',
  181. removeFavoriteSearchButtonTitle: 'Remover dos favoritos'
  182. },
  183. errorScreen: {
  184. titleText: 'Não foi possível obter resultados',
  185. helpText: 'Verifique a sua conexão de rede'
  186. },
  187. footer: {
  188. selectText: 'Selecionar',
  189. navigateText: 'Navegar',
  190. closeText: 'Fechar',
  191. searchByText: 'Pesquisa por'
  192. },
  193. noResultsScreen: {
  194. noResultsText: 'Não foi possível encontrar resultados',
  195. suggestedQueryText: 'Você pode tentar uma nova consulta',
  196. reportMissingResultsText:
  197. 'Deveriam haver resultados para essa consulta?',
  198. reportMissingResultsLinkText: 'Clique para enviar feedback'
  199. }
  200. }
  201. }
  202. }
  203. }