|
| 1 | +import { fileURLToPath, URL } from 'url' |
| 2 | + |
| 3 | +import { defineConfig } from 'vitepress' |
| 4 | +import { whyframe } from '@whyframe/core' |
| 5 | +import { whyframeVue } from '@whyframe/vue' |
| 6 | +import { hmrFix } from './plugins/hmrFix.js' |
| 7 | + |
| 8 | +// https://vitepress.dev/reference/site-config |
| 9 | +export default defineConfig({ |
| 10 | + title: "VueDsfr", |
| 11 | + description: "Une documentation pour les utilisateurs de VueDsfr", |
| 12 | + |
| 13 | + cleanUrls: true, |
| 14 | + appearance: { listenToStorageChanges: false }, // handling this in Story.vue itself to avoid flickering |
| 15 | + |
| 16 | + rewrites: { |
| 17 | + 'src/components/:comp/:comp.md': 'composants/:comp.md', |
| 18 | + 'docs/:splat*': ':splat*', |
| 19 | + }, |
| 20 | + |
| 21 | + themeConfig: { |
| 22 | + search: { |
| 23 | + provider: 'local', |
| 24 | + options: { |
| 25 | + translations: { |
| 26 | + button: { |
| 27 | + buttonText: 'Rechercher...', |
| 28 | + buttonAriaLabel: 'Rechercher' |
| 29 | + }, |
| 30 | + modal: { |
| 31 | + backButtonTitle: 'effacer la recherche', |
| 32 | + displayDetails: 'afficher les détails', |
| 33 | + noResultsText: 'Aucun résultat pour ', |
| 34 | + resetButtonTitle: 'resetButtonTitle', |
| 35 | + footer: { |
| 36 | + selectText: 'aller à ce texte', |
| 37 | + navigateText: 'naviguer dans les résultats', |
| 38 | + closeText: 'fermer' |
| 39 | + } |
| 40 | + } |
| 41 | + }, |
| 42 | + } |
| 43 | + }, |
| 44 | + outline:{ |
| 45 | + level: [2, 3], |
| 46 | + label: 'Sur cette page :', |
| 47 | + }, |
| 48 | + logo: '/nouveau-logo-marianne-gouvernement.png', |
| 49 | + // https://vitepress.dev/reference/default-theme-config |
| 50 | + nav: [ |
| 51 | + { text: 'Home', link: '/' }, |
| 52 | + ], |
| 53 | + |
| 54 | + sidebar: [ |
| 55 | + { |
| 56 | + text: 'Pour commencer', |
| 57 | + collapsed: false, |
| 58 | + items: [ |
| 59 | + { |
| 60 | + text: 'Commencer', |
| 61 | + link: '/pour-commencer', |
| 62 | + }, |
| 63 | + { |
| 64 | + text: 'L’écosystème', |
| 65 | + link: '/ecosysteme', |
| 66 | + }, |
| 67 | + { |
| 68 | + text: 'Les icônes', |
| 69 | + link: '/icones', |
| 70 | + }, |
| 71 | + { |
| 72 | + text: 'Guide du développeur', |
| 73 | + link: '/guide-developpeur', |
| 74 | + }, |
| 75 | + ] |
| 76 | + }, |
| 77 | + { |
| 78 | + text: 'Tous les types', |
| 79 | + link: '/types', |
| 80 | + items: [] |
| 81 | + }, |
| 82 | + { |
| 83 | + text: 'Tous les composants', |
| 84 | + link: '/composants', |
| 85 | + collapsed: false, |
| 86 | + items: [ |
| 87 | + { |
| 88 | + text: 'DsfrAlert', |
| 89 | + link: '/composants/DsfrAlert.md', |
| 90 | + }, |
| 91 | + { |
| 92 | + text: 'DsfrBadge', |
| 93 | + link: '/composants/DsfrBadge.md', |
| 94 | + }, |
| 95 | + ] |
| 96 | + }, |
| 97 | + { |
| 98 | + text: 'Recettes nuxt', |
| 99 | + link: '/nuxt/', |
| 100 | + }, |
| 101 | + ], |
| 102 | + |
| 103 | + socialLinks: [ |
| 104 | + { icon: 'github', link: 'https://github.com/dnum-mi/vue-dsfr' } |
| 105 | + ] |
| 106 | + }, |
| 107 | + |
| 108 | + vite: { |
| 109 | + plugins: [ |
| 110 | + whyframe({ defaultSrc: '/_frame', components: [{ name: 'Story' }] }), |
| 111 | + whyframeVue({ include: /\.(vue|md)$/ }), |
| 112 | + hmrFix() |
| 113 | + ], |
| 114 | + |
| 115 | + resolve: { |
| 116 | + alias: { |
| 117 | + '@': fileURLToPath(new URL('../src', import.meta.url)), |
| 118 | + } |
| 119 | + }, |
| 120 | + |
| 121 | + // not needed, just there to prevent reload on cold start |
| 122 | + optimizeDeps: { |
| 123 | + include: [ |
| 124 | + '@vueuse/core', |
| 125 | + ] |
| 126 | + } |
| 127 | + }, |
| 128 | +}) |
0 commit comments