Skip to content

Commit 63a1fe5

Browse files
joshistoastjoshistoastlstein
authored
fix(docs): deployment paths mismatch (#9067)
also adds the favicon Co-authored-by: joshistoast <me@joshcorbett.com> Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
1 parent 3c17a56 commit 63a1fe5

4 files changed

Lines changed: 42 additions & 9 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
- 'opened'
1111
- 'synchronize'
1212
workflow_dispatch:
13+
inputs:
14+
deploy_target:
15+
description: 'Deploy target (custom = invoke.ai, ghpages = invoke-ai.github.io/InvokeAI)'
16+
type: choice
17+
options:
18+
- custom
19+
- ghpages
20+
default: custom
1321

1422
permissions:
1523
contents: read
@@ -68,6 +76,8 @@ jobs:
6876
- name: build docs
6977
run: pnpm build
7078
working-directory: docs
79+
env:
80+
DEPLOY_TARGET: ${{ inputs.deploy_target || 'custom' }}
7181

7282
# Upload artifact for deploy (main branch only)
7383
- name: upload pages artifact

docs/astro.config.mjs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ import starlightLlmsText from 'starlight-llms-txt';
88
import starlightChangelogs, { makeChangelogsSidebarLinks } from 'starlight-changelogs';
99
// import starlightContextualMenu from 'starlight-contextual-menu';
1010

11+
// Deployment target: 'custom' (default, custom domain at invoke.ai) or 'ghpages'
12+
// (GitHub Pages project URL at invoke-ai.github.io/InvokeAI). Drive site/base from this
13+
// so the same source can be deployed to either target.
14+
const deployTarget = process.env.DEPLOY_TARGET ?? 'custom';
15+
const isGhPages = deployTarget === 'ghpages';
16+
1117
// https://astro.build/config
1218
export default defineConfig({
13-
site: 'https://invoke.ai',
14-
// base is only needed if no custom domain is available, or if the site is hosted in a subdirectory
15-
// base: '/InvokeAI',
19+
site: isGhPages ? 'https://invoke-ai.github.io' : 'https://invoke.ai',
20+
base: isGhPages ? '/InvokeAI' : undefined,
1621
integrations: [
1722
starlight({
1823
// Content
@@ -24,7 +29,7 @@ export default defineConfig({
2429
alt: 'InvokeAI Logo',
2530
replacesTitle: true,
2631
},
27-
favicon: './src/assets/invoke-icon.svg',
32+
favicon: '/favicon.svg',
2833
editLink: {
2934
baseUrl: 'https://github.com/invoke-ai/InvokeAI/edit/main/docs',
3035
},
@@ -117,10 +122,17 @@ export default defineConfig({
117122
PageFrame: './src/layouts/PageFrameExtended.astro',
118123
},
119124
plugins: [
120-
starlightLinksValidator({
121-
errorOnRelativeLinks: false,
122-
errorOnLocalLinks: false,
123-
}),
125+
// The links validator is skipped for the ghpages target because content uses
126+
// root-absolute links (e.g. /concepts/...) that don't include the /InvokeAI base.
127+
// Production (custom domain) still enforces link validation.
128+
...(isGhPages
129+
? []
130+
: [
131+
starlightLinksValidator({
132+
errorOnRelativeLinks: false,
133+
errorOnLocalLinks: false,
134+
}),
135+
]),
124136
starlightLlmsText(),
125137
starlightChangelogs(),
126138
// starlightContextualMenu({

docs/public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
invoke.ai

docs/public/favicon.svg

Lines changed: 11 additions & 1 deletion
Loading

0 commit comments

Comments
 (0)