@@ -8,11 +8,16 @@ import starlightLlmsText from 'starlight-llms-txt';
88import 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
1218export 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({
0 commit comments