|
| 1 | +import { transformerTwoslash } from '@shikijs/vitepress-twoslash'; |
| 2 | +import tailwindcss from '@tailwindcss/vite'; |
| 3 | +import { defineConfig, loadEnv } from 'vitepress'; |
| 4 | +import { fileURLToPath, URL } from 'node:url'; |
| 5 | +import { getSidebar } from './sidebar'; |
| 6 | +import { |
| 7 | + groupIconMdPlugin, |
| 8 | + groupIconVitePlugin, |
| 9 | +} from 'vitepress-plugin-group-icons'; |
| 10 | +import { withMermaid } from 'vitepress-plugin-mermaid'; |
| 11 | + |
| 12 | +// Charger les variables d'environnement |
| 13 | +const env = loadEnv('', process.cwd()); |
| 14 | + |
| 15 | +// https://vitepress.dev/reference/site-config |
| 16 | +export default withMermaid( |
| 17 | + defineConfig({ |
| 18 | + title: 'iExec documentation', |
| 19 | + description: |
| 20 | + 'Build decentralized applications that combine ownership, privacy, and monetization.', |
| 21 | + cleanUrls: true, |
| 22 | + lastUpdated: true, |
| 23 | + vite: { |
| 24 | + plugins: [tailwindcss(), groupIconVitePlugin()], |
| 25 | + resolve: { |
| 26 | + alias: { |
| 27 | + '@': fileURLToPath(new URL('../src', import.meta.url)), |
| 28 | + }, |
| 29 | + }, |
| 30 | + // Expose environment variables to the client |
| 31 | + define: { |
| 32 | + 'import.meta.env.VITE_REOWN_PROJECT_ID': JSON.stringify( |
| 33 | + env.VITE_REOWN_PROJECT_ID |
| 34 | + ), |
| 35 | + }, |
| 36 | + }, |
| 37 | + srcDir: './src', |
| 38 | + markdown: { |
| 39 | + codeTransformers: [transformerTwoslash()], |
| 40 | + config(md) { |
| 41 | + md.use(groupIconMdPlugin); |
| 42 | + }, |
| 43 | + }, |
| 44 | + |
| 45 | + head: [ |
| 46 | + ['link', { rel: 'icon', href: '/Logo-RLC-Yellow.png' }], |
| 47 | + [ |
| 48 | + 'link', |
| 49 | + { |
| 50 | + rel: 'stylesheet', |
| 51 | + href: 'https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap', |
| 52 | + }, |
| 53 | + ], |
| 54 | + [ |
| 55 | + 'script', |
| 56 | + {}, |
| 57 | + ` |
| 58 | + window.axeptioSettings = { |
| 59 | + clientId: "6413111857e4d2a6342cd5c6", |
| 60 | + cookiesVersion: "iexec-en", |
| 61 | + }; |
| 62 | +
|
| 63 | + (function(d, s) { |
| 64 | + var t = d.getElementsByTagName(s)[0], e = d.createElement(s); |
| 65 | + e.async = true; e.src = "//static.axept.io/sdk.js"; |
| 66 | + t.parentNode.insertBefore(e, t); |
| 67 | + })(document, "script"); |
| 68 | + `, |
| 69 | + ], |
| 70 | + // Mava widget |
| 71 | + [ |
| 72 | + 'script', |
| 73 | + { |
| 74 | + defer: '', |
| 75 | + src: 'https://widget.mava.app', |
| 76 | + 'widget-version': 'v2', |
| 77 | + id: 'MavaWebChat', |
| 78 | + 'enable-sdk': 'false', |
| 79 | + 'data-token': |
| 80 | + '8e4e10aad5750451e8726768e8c639dae54f461beeb176f5ebd687371c9390f2', |
| 81 | + }, |
| 82 | + ], |
| 83 | + // Hotjar Tracking Script |
| 84 | + [ |
| 85 | + 'script', |
| 86 | + {}, |
| 87 | + ` |
| 88 | + (function(h,o,t,j,a,r){ |
| 89 | + h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; |
| 90 | + h._hjSettings={hjid:5303222,hjsv:6}; |
| 91 | + a=o.getElementsByTagName('head')[0]; |
| 92 | + r=o.createElement('script');r.async=1; |
| 93 | + r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; |
| 94 | + a.appendChild(r); |
| 95 | + })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); |
| 96 | + `, |
| 97 | + ], |
| 98 | + ], |
| 99 | + |
| 100 | + themeConfig: { |
| 101 | + // https://vitepress.dev/reference/default-theme-config |
| 102 | + nav: [ |
| 103 | + { text: 'Get Started', link: '/get-started/welcome' }, |
| 104 | + { text: 'Guides', link: '/guides/build-iapp/' }, |
| 105 | + { text: 'References', link: '/references/dataProtector' }, |
| 106 | + { |
| 107 | + component: 'ChainSelector', |
| 108 | + props: { |
| 109 | + className: 'w-48', |
| 110 | + }, |
| 111 | + }, |
| 112 | + ], |
| 113 | + outline: { |
| 114 | + level: [2, 4], |
| 115 | + }, |
| 116 | + |
| 117 | + sidebar: getSidebar(), |
| 118 | + |
| 119 | + search: { |
| 120 | + provider: 'local', |
| 121 | + }, |
| 122 | + |
| 123 | + socialLinks: [ |
| 124 | + { icon: 'github', link: 'https://github.com/iExecBlockchainComputing' }, |
| 125 | + { icon: 'x', link: 'https://twitter.com/iEx_ec' }, |
| 126 | + { icon: 'discord', link: 'https://discord.com/invite/pbt9m98wnU' }, |
| 127 | + ], |
| 128 | + |
| 129 | + editLink: { |
| 130 | + pattern: |
| 131 | + 'https://github.com/iExecBlockchainComputing/documentation/blob/main/:path', |
| 132 | + text: 'Suggest changes to this page', |
| 133 | + }, |
| 134 | + |
| 135 | + logo: { |
| 136 | + light: '/Logo-RLC-Yellow.png', |
| 137 | + dark: '/Logo-RLC-Yellow.png', |
| 138 | + alt: 'iExec logo', |
| 139 | + }, |
| 140 | + }, |
| 141 | + }) |
| 142 | +); |
0 commit comments