Skip to content

Commit

Permalink
docs(fix): include local search (#570)
Browse files Browse the repository at this point in the history
* docs(fix): include local search

* chore: fix types in theme module

* chore: add missing spanish directives

* docs: move search local config to each language config

* chore: cleanup VP vite config file

---------

Co-authored-by: Alvaro Saburido <alvaro.saburido@gmail.com>
  • Loading branch information
userquin and alvarosabu authored Mar 4, 2024
1 parent 8d5c139 commit 9bc7a72
Show file tree
Hide file tree
Showing 15 changed files with 571 additions and 508 deletions.
202 changes: 0 additions & 202 deletions docs/.vitepress/config.ts

This file was deleted.

30 changes: 30 additions & 0 deletions docs/.vitepress/config/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,35 @@ export const deConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
],
},
],
search: {
provider: 'local',
options: {
locales: {
de: {
translations: {
button: {
buttonText: 'Suchen',
buttonAriaLabel: 'Suchen',
},
modal: {
displayDetails: 'Detaillierte Liste anzeigen',
resetButtonTitle: 'Suche zurücksetzen',
backButtonTitle: 'Suche schließen',
noResultsText: 'Keine Ergebnisse für',
footer: {
selectText: 'zur Auswahl',
selectKeyAriaLabel: 'enter',
navigateText: 'zum Navigieren',
navigateUpKeyAriaLabel: 'Pfeil nach oben',
navigateDownKeyAriaLabel: 'Pfeil nach unten',
closeText: 'zum Schließen',
closeKeyAriaLabel: 'escape',
},
},
},
},
},
},
},
},
}
4 changes: 2 additions & 2 deletions docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
],
},
],
},
},
],
},
}
}
34 changes: 32 additions & 2 deletions docs/.vitepress/config/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,37 @@ export const esConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
],
},
],
},
},
],
search: {
provider: 'local',
options: {
locales: {
es: {
translations: {
button: {
buttonText: 'Buscar',
buttonAriaLabel: 'Buscar',
},
modal: {
displayDetails: 'Mostrar lista detallada',
resetButtonTitle: 'Restablecer búsqueda',
backButtonTitle: 'Cerrar búsqueda',
noResultsText: 'Sin resultados para',
footer: {
selectText: 'para seleccionar',
selectKeyAriaLabel: 'entrar',
navigateText: 'para navegar',
navigateUpKeyAriaLabel: 'flecha arriba',
navigateDownKeyAriaLabel: 'flecha abajo',
closeText: 'para cerrar',
closeKeyAriaLabel: 'escape',
},
},
},
},
},
},
},
},
}
}
2 changes: 1 addition & 1 deletion docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export default defineConfig({
de: { label: 'Deutsch', lang: 'de-DE', link: '/de/', ...deConfig },
/* zh: { label: '简体中文', lang: 'zh-CN', link: '/zh/', ...zhConfig }, */
},
})
})
35 changes: 33 additions & 2 deletions docs/.vitepress/config/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,37 @@ export const sharedConfig = defineConfig({
],
themeConfig: {
logo: '/logo.svg',
search: {
provider: 'local',
options: {
locales: {
root: {
translations: {
button: {
buttonText: 'Search',
buttonAriaLabel: 'Search',
},
modal: {
displayDetails: 'Display detailed list',
resetButtonTitle: 'Reset search',
backButtonTitle: 'Close search',
noResultsText: 'No results for',
footer: {
selectText: 'to select',
selectKeyAriaLabel: 'enter',
navigateText: 'to navigate',
navigateUpKeyAriaLabel: 'up arrow',
navigateDownKeyAriaLabel: 'down arrow',
closeText: 'to close',
closeKeyAriaLabel: 'escape',
},
},
},
},

},
},
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/tresjs/tres' },
{ icon: 'x', link: 'https://twitter.com/tresjs_dev' },
Expand All @@ -39,7 +70,7 @@ export const sharedConfig = defineConfig({
vite: {
optimizeDeps: {
exclude: ['vitepress'],
include: ['three'],
include: ['@tresjs/cientos', '@stackblitz/sdk', '@vueuse/core', 'three'],
},
server: {
hmr: {
Expand All @@ -60,4 +91,4 @@ export const sharedConfig = defineConfig({
},
},
},
})
})
17 changes: 8 additions & 9 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'uno.css'
import type { Theme } from 'vitepress'
import VPTheme from 'vitepress/theme'

// .vitepress/theme/index.ts
import Theme from 'vitepress/theme'
import 'uno.css'
import './custom.css'

import TresLayout from './TresLayout.vue'
Expand All @@ -18,11 +18,10 @@ import TresLayout from './TresLayout.vue'
}) */

export default {
...Theme,
...VPTheme,

enhanceApp(ctx) {
Theme.enhanceApp(ctx)
/* ctx.app.use(plausible) */
},
/* enhanceApp(ctx) {
ctx.app.use(plausible)
}, */
Layout: TresLayout,
}
} satisfies Theme
Loading

0 comments on commit 9bc7a72

Please sign in to comment.