|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | + |
| 3 | +export default defineConfig({ |
| 4 | + title: 'Stability Matrix Docs', |
| 5 | + description: 'Documentation for Stability Matrix, a multi-platform package manager for Stable Diffusion and related AI tools.', |
| 6 | + |
| 7 | + // Serve everything under /stability-matrix/ from day one so URLs survive the |
| 8 | + // planned move to a multi-product docs repo (SM + Chat + Bench sections) with |
| 9 | + // zero redirects. README.md doubles as the section index. The bare site root |
| 10 | + // 302s here via public/staticwebapp.config.json until a landing page exists. |
| 11 | + rewrites: { |
| 12 | + 'README.md': 'stability-matrix/index.md', |
| 13 | + ':path(.*)': 'stability-matrix/:path' |
| 14 | + }, |
| 15 | + |
| 16 | + // Dead-link checking stays ON (default) so a future PR that breaks a |
| 17 | + // relative link fails the build instead of shipping silently. |
| 18 | + ignoreDeadLinks: false, |
| 19 | + |
| 20 | + markdown: { |
| 21 | + config(md) { |
| 22 | + // README.md is rewritten to the section index, but VitePress emits |
| 23 | + // relative hrefs verbatim — a content link like `./../README` would |
| 24 | + // point at a README.html that doesn't exist in the built site (it |
| 25 | + // renders fine on GitHub and in the in-app viewer, so the content is |
| 26 | + // correct; the mismatch is this site's rewrite). Normalize such links |
| 27 | + // to directory-index form, which resolves everywhere. |
| 28 | + md.core.ruler.push('sm-readme-links', (state) => { |
| 29 | + for (const token of state.tokens) { |
| 30 | + if (token.type !== 'inline' || !token.children) continue |
| 31 | + for (const child of token.children) { |
| 32 | + if (child.type !== 'link_open') continue |
| 33 | + const href = child.attrGet('href') |
| 34 | + const match = href?.match(/^(?:\.\/)?((?:\.\.\/)*)README(?:\.md)?(#.*)?$/) |
| 35 | + if (match) { |
| 36 | + child.attrSet('href', (match[1] || './') + (match[2] ?? '')) |
| 37 | + } |
| 38 | + } |
| 39 | + } |
| 40 | + }) |
| 41 | + } |
| 42 | + }, |
| 43 | + |
| 44 | + appearance: 'dark', |
| 45 | + |
| 46 | + // Requires full git history at build time (fetch-depth: 0 in the deploy job). |
| 47 | + lastUpdated: true, |
| 48 | + |
| 49 | + sitemap: { |
| 50 | + hostname: 'https://docs.lykos.ai' |
| 51 | + }, |
| 52 | + |
| 53 | + themeConfig: { |
| 54 | + outline: 'deep', |
| 55 | + |
| 56 | + // The site-title link defaults to the bare site root, which only resolves |
| 57 | + // via the Azure SWA redirect — point it at the section index directly so |
| 58 | + // it also works in local preview (and needs no redirect hop in prod). |
| 59 | + logoLink: '/stability-matrix/', |
| 60 | + |
| 61 | + search: { |
| 62 | + provider: 'local' |
| 63 | + }, |
| 64 | + |
| 65 | + editLink: { |
| 66 | + pattern: 'https://github.com/LykosAI/StabilityMatrix/edit/main/docs/:path', |
| 67 | + text: 'Edit this page on GitHub' |
| 68 | + }, |
| 69 | + |
| 70 | + nav: [ |
| 71 | + { text: 'Home', link: '/stability-matrix/' }, |
| 72 | + { text: 'Getting Started', link: '/stability-matrix/getting-started/overview' }, |
| 73 | + { text: 'Package Manager', link: '/stability-matrix/package-manager/overview' }, |
| 74 | + { text: 'Inference', link: '/stability-matrix/inference/overview' }, |
| 75 | + { text: 'Advanced', link: '/stability-matrix/advanced/overview' }, |
| 76 | + { text: 'Tips and Tricks', link: '/stability-matrix/tips/overview' }, |
| 77 | + { text: 'Troubleshooting', link: '/stability-matrix/troubleshooting/common-issues' } |
| 78 | + ], |
| 79 | + |
| 80 | + sidebar: { |
| 81 | + '/stability-matrix/getting-started/': [ |
| 82 | + { |
| 83 | + text: 'Getting Started', |
| 84 | + items: [ |
| 85 | + { text: 'Overview', link: '/stability-matrix/getting-started/overview' }, |
| 86 | + { text: 'Installation', link: '/stability-matrix/getting-started/installation' }, |
| 87 | + { text: 'First Launch', link: '/stability-matrix/getting-started/first-launch' }, |
| 88 | + { text: 'Data Directory', link: '/stability-matrix/getting-started/data-directory' } |
| 89 | + ] |
| 90 | + } |
| 91 | + ], |
| 92 | + '/stability-matrix/package-manager/': [ |
| 93 | + { |
| 94 | + text: 'Package Manager', |
| 95 | + items: [ |
| 96 | + { text: 'Overview', link: '/stability-matrix/package-manager/overview' }, |
| 97 | + { text: 'Supported Packages', link: '/stability-matrix/package-manager/supported-packages' }, |
| 98 | + { text: 'Installing Packages', link: '/stability-matrix/package-manager/installing-packages' } |
| 99 | + ] |
| 100 | + } |
| 101 | + ], |
| 102 | + '/stability-matrix/inference/': [ |
| 103 | + { |
| 104 | + text: 'Inference', |
| 105 | + items: [ |
| 106 | + { text: 'Overview', link: '/stability-matrix/inference/overview' } |
| 107 | + ] |
| 108 | + } |
| 109 | + ], |
| 110 | + '/stability-matrix/advanced/': [ |
| 111 | + { |
| 112 | + text: 'Advanced', |
| 113 | + items: [ |
| 114 | + { text: 'Overview', link: '/stability-matrix/advanced/overview' }, |
| 115 | + { text: 'Hardware Support', link: '/stability-matrix/advanced/hardware-support' }, |
| 116 | + { text: 'ComfyUI Integration', link: '/stability-matrix/advanced/comfyui-integration' }, |
| 117 | + { text: 'Environment Variables', link: '/stability-matrix/advanced/environment-variables' } |
| 118 | + ] |
| 119 | + } |
| 120 | + ], |
| 121 | + '/stability-matrix/tips/': [ |
| 122 | + { |
| 123 | + text: 'Tips and Tricks', |
| 124 | + items: [ |
| 125 | + { text: 'Overview', link: '/stability-matrix/tips/overview' }, |
| 126 | + { text: 'Terminology', link: '/stability-matrix/tips/terminology' } |
| 127 | + ] |
| 128 | + } |
| 129 | + ], |
| 130 | + '/stability-matrix/troubleshooting/': [ |
| 131 | + { |
| 132 | + text: 'Troubleshooting', |
| 133 | + items: [ |
| 134 | + { text: 'Common Issues', link: '/stability-matrix/troubleshooting/common-issues' } |
| 135 | + ] |
| 136 | + } |
| 137 | + ] |
| 138 | + }, |
| 139 | + |
| 140 | + socialLinks: [ |
| 141 | + { icon: 'github', link: 'https://github.com/LykosAI/StabilityMatrix' } |
| 142 | + ] |
| 143 | + } |
| 144 | +}) |
0 commit comments