@@ -4,16 +4,43 @@ export default defineConfig({
44 title : 'Stability Matrix Docs' ,
55 description : 'Documentation for Stability Matrix, a multi-platform package manager for Stable Diffusion and related AI tools.' ,
66
7- // Keep README.md as the single source of truth for the home page content,
8- // while serving it at the site root (index.html) instead of /README.html.
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.
911 rewrites : {
10- 'README.md' : 'index.md'
12+ 'README.md' : 'stability-matrix/index.md' ,
13+ ':path(.*)' : 'stability-matrix/:path'
1114 } ,
1215
1316 // Dead-link checking stays ON (default) so a future PR that breaks a
1417 // relative link fails the build instead of shipping silently.
1518 ignoreDeadLinks : false ,
1619
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 ( / ^ (?: \. \/ ) ? ( (?: \. \. \/ ) * ) R E A D M E (?: \. m d ) ? ( # .* ) ? $ / )
35+ if ( match ) {
36+ child . attrSet ( 'href' , ( match [ 1 ] || './' ) + ( match [ 2 ] ?? '' ) )
37+ }
38+ }
39+ }
40+ } )
41+ }
42+ } ,
43+
1744 appearance : 'dark' ,
1845
1946 // Requires full git history at build time (fetch-depth: 0 in the deploy job).
@@ -36,70 +63,70 @@ export default defineConfig({
3663 } ,
3764
3865 nav : [
39- { text : 'Home' , link : '/' } ,
40- { text : 'Getting Started' , link : '/getting-started/overview' } ,
41- { text : 'Package Manager' , link : '/package-manager/overview' } ,
42- { text : 'Inference' , link : '/inference/overview' } ,
43- { text : 'Advanced' , link : '/advanced/overview' } ,
44- { text : 'Tips and Tricks' , link : '/tips/overview' } ,
45- { text : 'Troubleshooting' , link : '/troubleshooting/common-issues' }
66+ { text : 'Home' , link : '/stability-matrix/ ' } ,
67+ { text : 'Getting Started' , link : '/stability-matrix/ getting-started/overview' } ,
68+ { text : 'Package Manager' , link : '/stability-matrix/ package-manager/overview' } ,
69+ { text : 'Inference' , link : '/stability-matrix/ inference/overview' } ,
70+ { text : 'Advanced' , link : '/stability-matrix/ advanced/overview' } ,
71+ { text : 'Tips and Tricks' , link : '/stability-matrix/ tips/overview' } ,
72+ { text : 'Troubleshooting' , link : '/stability-matrix/ troubleshooting/common-issues' }
4673 ] ,
4774
4875 sidebar : {
49- '/getting-started/' : [
76+ '/stability-matrix/ getting-started/' : [
5077 {
5178 text : 'Getting Started' ,
5279 items : [
53- { text : 'Overview' , link : '/getting-started/overview' } ,
54- { text : 'Installation' , link : '/getting-started/installation' } ,
55- { text : 'First Launch' , link : '/getting-started/first-launch' } ,
56- { text : 'Data Directory' , link : '/getting-started/data-directory' }
80+ { text : 'Overview' , link : '/stability-matrix/ getting-started/overview' } ,
81+ { text : 'Installation' , link : '/stability-matrix/ getting-started/installation' } ,
82+ { text : 'First Launch' , link : '/stability-matrix/ getting-started/first-launch' } ,
83+ { text : 'Data Directory' , link : '/stability-matrix/ getting-started/data-directory' }
5784 ]
5885 }
5986 ] ,
60- '/package-manager/' : [
87+ '/stability-matrix/ package-manager/' : [
6188 {
6289 text : 'Package Manager' ,
6390 items : [
64- { text : 'Overview' , link : '/package-manager/overview' } ,
65- { text : 'Supported Packages' , link : '/package-manager/supported-packages' } ,
66- { text : 'Installing Packages' , link : '/package-manager/installing-packages' }
91+ { text : 'Overview' , link : '/stability-matrix/ package-manager/overview' } ,
92+ { text : 'Supported Packages' , link : '/stability-matrix/ package-manager/supported-packages' } ,
93+ { text : 'Installing Packages' , link : '/stability-matrix/ package-manager/installing-packages' }
6794 ]
6895 }
6996 ] ,
70- '/inference/' : [
97+ '/stability-matrix/ inference/' : [
7198 {
7299 text : 'Inference' ,
73100 items : [
74- { text : 'Overview' , link : '/inference/overview' }
101+ { text : 'Overview' , link : '/stability-matrix/ inference/overview' }
75102 ]
76103 }
77104 ] ,
78- '/advanced/' : [
105+ '/stability-matrix/ advanced/' : [
79106 {
80107 text : 'Advanced' ,
81108 items : [
82- { text : 'Overview' , link : '/advanced/overview' } ,
83- { text : 'Hardware Support' , link : '/advanced/hardware-support' } ,
84- { text : 'ComfyUI Integration' , link : '/advanced/comfyui-integration' } ,
85- { text : 'Environment Variables' , link : '/advanced/environment-variables' }
109+ { text : 'Overview' , link : '/stability-matrix/ advanced/overview' } ,
110+ { text : 'Hardware Support' , link : '/stability-matrix/ advanced/hardware-support' } ,
111+ { text : 'ComfyUI Integration' , link : '/stability-matrix/ advanced/comfyui-integration' } ,
112+ { text : 'Environment Variables' , link : '/stability-matrix/ advanced/environment-variables' }
86113 ]
87114 }
88115 ] ,
89- '/tips/' : [
116+ '/stability-matrix/ tips/' : [
90117 {
91118 text : 'Tips and Tricks' ,
92119 items : [
93- { text : 'Overview' , link : '/tips/overview' } ,
94- { text : 'Terminology' , link : '/tips/terminology' }
120+ { text : 'Overview' , link : '/stability-matrix/ tips/overview' } ,
121+ { text : 'Terminology' , link : '/stability-matrix/ tips/terminology' }
95122 ]
96123 }
97124 ] ,
98- '/troubleshooting/' : [
125+ '/stability-matrix/ troubleshooting/' : [
99126 {
100127 text : 'Troubleshooting' ,
101128 items : [
102- { text : 'Common Issues' , link : '/troubleshooting/common-issues' }
129+ { text : 'Common Issues' , link : '/stability-matrix/ troubleshooting/common-issues' }
103130 ]
104131 }
105132 ]
0 commit comments