Skip to content

Commit 1150f87

Browse files
authored
Merge pull request #1676 from LykosAI/docs-site-scaffold
docs: VitePress docs site + Azure SWA deploy workflow
2 parents eff0148 + 77295e6 commit 1150f87

6 files changed

Lines changed: 2769 additions & 0 deletions

File tree

.github/workflows/docs-site.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Docs Site
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
pull_request:
9+
paths:
10+
- 'docs/**'
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: docs-site-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build_and_deploy:
19+
if: github.event_name != 'pull_request'
20+
runs-on: ubuntu-latest
21+
name: Build and deploy docs site
22+
permissions:
23+
contents: read
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
# Full history so VitePress lastUpdated timestamps are accurate
28+
fetch-depth: 0
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: 'npm'
35+
cache-dependency-path: docs/package-lock.json
36+
37+
- name: Install dependencies
38+
working-directory: docs
39+
run: npm ci
40+
41+
- name: Build VitePress site
42+
working-directory: docs
43+
run: npx vitepress build .
44+
45+
- name: Deploy to Azure Static Web Apps
46+
uses: Azure/static-web-apps-deploy@v1
47+
with:
48+
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_DOCS }}
49+
repo_token: ${{ secrets.GITHUB_TOKEN }}
50+
action: upload
51+
app_location: 'docs/.vitepress/dist'
52+
skip_app_build: true
53+
54+
build_check:
55+
if: github.event_name == 'pull_request'
56+
runs-on: ubuntu-latest
57+
name: Build check (docs site)
58+
permissions:
59+
contents: read
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Set up Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: '20'
67+
cache: 'npm'
68+
cache-dependency-path: docs/package-lock.json
69+
70+
- name: Install dependencies
71+
working-directory: docs
72+
run: npm ci
73+
74+
- name: Build VitePress site
75+
working-directory: docs
76+
run: npx vitepress build .

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vitepress/dist
3+
.vitepress/cache

docs/.vitepress/config.mts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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

Comments
 (0)