| 1 | import { defineConfig } from 'vitepress'; |
| 2 | |
| 3 | const title = 'tsx'; |
| 4 | const description = 'tsx (TypeScript Execute) - The easiest way to run TypeScript in Node.js'; |
| 5 | |
| 6 | export default defineConfig({ |
| 7 | lang: 'en-US', |
| 8 | |
| 9 | title, |
| 10 | |
| 11 | description, |
| 12 | |
| 13 | lastUpdated: true, |
| 14 | |
| 15 | cleanUrls: true, |
| 16 | |
| 17 | ignoreDeadLinks: true, |
| 18 | |
| 19 | metaChunk: true, |
| 20 | |
| 21 | head: [ |
| 22 | ['link', { |
| 23 | rel: 'icon', |
| 24 | type: 'image/svg+xml', |
| 25 | href: '/logo-mini.svg', |
| 26 | }], |
| 27 | ['meta', { |
| 28 | property: 'og:title', |
| 29 | content: title, |
| 30 | }], |
| 31 | ['meta', { |
| 32 | property: 'og:type', |
| 33 | content: 'website', |
| 34 | }], |
| 35 | ['meta', { |
| 36 | property: 'og:image', |
| 37 | content: 'https://tsx.hirok.io/social.png', |
| 38 | }], |
| 39 | ['meta', { |
| 40 | property: 'og:url', |
| 41 | content: 'https://tsx.hirok.io', |
| 42 | }], |
| 43 | ['meta', { |
| 44 | property: 'og:description', |
| 45 | content: description, |
| 46 | }], |
| 47 | ['meta', { |
| 48 | property: 'og:site_name', |
| 49 | content: title, |
| 50 | }], |
| 51 | ['meta', { |
| 52 | name: 'twitter:card', |
| 53 | content: 'summary_large_image', |
| 54 | }], |
| 55 | ['meta', { |
| 56 | name: 'twitter:site', |
| 57 | content: '@tsx_is', |
| 58 | }], |
| 59 | ['script', { |
| 60 | src: 'https://beamanalytics.b-cdn.net/beam.min.js', |
| 61 | 'data-token': 'ee893e1d-7484-4fb3-85b7-78c58b3d9c9e', |
| 62 | async: '', |
| 63 | }], |
| 64 | ], |
| 65 | |
| 66 | themeConfig: { |
| 67 | siteTitle: false, |
| 68 | |
| 69 | logo: { |
| 70 | light: '/logo-light.svg', |
| 71 | dark: '/logo-dark.svg', |
| 72 | alt: 'tsx', |
| 73 | }, |
| 74 | |
| 75 | outline: 'deep', |
| 76 | |
| 77 | editLink: { |
| 78 | pattern: 'https://github.com/privatenumber/tsx/edit/master/docs/:path', |
| 79 | text: 'Propose changes to this page', |
| 80 | }, |
| 81 | |
| 82 | nav: [ |
| 83 | { |
| 84 | text: 'User guide', |
| 85 | link: '/', |
| 86 | activeMatch: '^(?!\/dev-api\/).*', |
| 87 | }, |
| 88 | { |
| 89 | text: 'Developer API', |
| 90 | link: '/dev-api/', |
| 91 | activeMatch: '/dev-api/', |
| 92 | }, |
| 93 | ], |
| 94 | |
| 95 | sidebar: { |
| 96 | '/': [ |
| 97 | { |
| 98 | text: 'Introduction', |
| 99 | items: [ |
| 100 | { |
| 101 | text: 'About tsx', |
| 102 | link: '/', |
| 103 | }, |
| 104 | { |
| 105 | text: 'Getting started', |
| 106 | link: '/getting-started', |
| 107 | }, |
| 108 | ], |
| 109 | }, |
| 110 | { |
| 111 | text: 'Usage', |
| 112 | items: [ |
| 113 | { |
| 114 | text: 'Node.js enhancement', |
| 115 | link: '/node-enhancement', |
| 116 | }, |
| 117 | { |
| 118 | text: 'Watch mode', |
| 119 | link: '/watch-mode', |
| 120 | }, |
| 121 | ], |
| 122 | }, |
| 123 | { |
| 124 | text: 'Integration', |
| 125 | items: [ |
| 126 | { |
| 127 | text: 'TypeScript', |
| 128 | link: '/typescript', |
| 129 | }, |
| 130 | { |
| 131 | text: 'Compilation', |
| 132 | link: '/compilation', |
| 133 | }, |
| 134 | { |
| 135 | text: 'Shell scripts', |
| 136 | link: '/shell-scripts', |
| 137 | }, |
| 138 | { |
| 139 | text: 'VSCode debugging', |
| 140 | link: '/vscode', |
| 141 | }, |
| 142 | ] |
| 143 | }, |
| 144 | { |
| 145 | text: 'Support', |
| 146 | items: [ |
| 147 | { |
| 148 | text: 'FAQ', |
| 149 | link: '/faq', |
| 150 | docFooterText: 'Frequently Asked Questions', |
| 151 | }, |
| 152 | { |
| 153 | text: 'Learning resources', |
| 154 | link: '/learn', |
| 155 | }, |
| 156 | { |
| 157 | text: 'Help center (Sponsors only)', |
| 158 | link: 'https://github.com/pvtnbr/tsx/discussions', |
| 159 | }, |
| 160 | { |
| 161 | text: 'Become a Sponsor', |
| 162 | link: 'https://github.com/sponsors/privatenumber/sponsorships?tier_id=416984', |
| 163 | }, |
| 164 | ], |
| 165 | }, |
| 166 | ], |
| 167 | '/dev-api/': [ |
| 168 | { |
| 169 | text: 'About the Developer API', |
| 170 | link: '/dev-api/', |
| 171 | }, |
| 172 | { |
| 173 | text: 'Automatic registration', |
| 174 | items: [ |
| 175 | { |
| 176 | text: 'Node.js CLI', |
| 177 | link: '/dev-api/node-cli' |
| 178 | }, |
| 179 | { |
| 180 | text: 'Entry-point', |
| 181 | link: '/dev-api/entry-point' |
| 182 | }, |
| 183 | ], |
| 184 | }, |
| 185 | { |
| 186 | text: 'Scoped TS loading', |
| 187 | items: [ |
| 188 | { |
| 189 | text: 'tsImport()', |
| 190 | link: '/dev-api/ts-import' |
| 191 | }, |
| 192 | { |
| 193 | text: 'tsx.require()', |
| 194 | link: '/dev-api/tsx-require' |
| 195 | }, |
| 196 | ], |
| 197 | }, |
| 198 | { |
| 199 | text: 'Register API', |
| 200 | items: [ |
| 201 | { |
| 202 | text: 'CommonJS', |
| 203 | link: '/dev-api/register-cjs' |
| 204 | }, |
| 205 | { |
| 206 | text: 'ESM', |
| 207 | link: '/dev-api/register-esm' |
| 208 | }, |
| 209 | ], |
| 210 | }, |
| 211 | ], |
| 212 | }, |
| 213 | |
| 214 | socialLinks: [ |
| 215 | { |
| 216 | icon: 'github', |
| 217 | link: 'https://github.com/privatenumber/tsx', |
| 218 | }, |
| 219 | { |
| 220 | icon: 'x', |
| 221 | link: 'https://x.com/tsx_is', |
| 222 | }, |
| 223 | { |
| 224 | icon: { |
| 225 | svg: '<svg viewBox="0 0 24 24"><path d="M22 4H2v16h20zm-2 4l-8 5l-8-5V6l8 5l8-5z"/></svg>' |
| 226 | }, |
| 227 | link: '/contact' |
| 228 | } |
| 229 | ], |
| 230 | |
| 231 | search: { |
| 232 | provider: 'local', |
| 233 | }, |
| 234 | |
| 235 | carbonAds: { |
| 236 | code: 'CW7DEKJY', |
| 237 | placement: 'tsxis', |
| 238 | }, |
| 239 | }, |
| 240 | }); |