Files
wehub-resource-sync cddb07a176
build container image / cpu (push) Waiting to run
build container image / cuda (push) Waiting to run
build container image / rocm (push) Waiting to run
frontend tests / frontend-tests (push) Waiting to run
openapi checks / openapi-checks (push) Waiting to run
python tests / py3.12: macos-default (push) Waiting to run
python tests / py3.11: windows-cpu (push) Waiting to run
python tests / py3.12: windows-cpu (push) Waiting to run
python tests / py3.11: linux-cpu (push) Waiting to run
python tests / py3.12: linux-cpu (push) Waiting to run
typegen checks / typegen-checks (push) Waiting to run
uv lock checks / uv-lock-checks (push) Waiting to run
frontend checks / frontend-checks (push) Waiting to run
lfs checks / lfs-check (push) Waiting to run
python checks / python-checks (push) Waiting to run
python tests / py3.11: macos-default (push) Waiting to run
docs / deploy (push) Has been cancelled
docs / changes (push) Has been cancelled
docs / check-and-build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:06 +08:00

93 lines
2.7 KiB
JavaScript

// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
// Plugins
import starlightLinksValidator from 'starlight-links-validator';
import starlightLlmsText from 'starlight-llms-txt';
import starlightChangelogs from 'starlight-changelogs';
import { rehypePrefixBaseToRootLinks } from './plugins/rehype-prefix-base-to-root-links.mjs';
import starlightContextualMenu from 'starlight-contextual-menu';
// Configs
import {
createHeadConfig,
createRedirects,
sidebarConfig,
socialConfig,
} from './src/config';
// Deployment target: 'custom' (default, custom domain at invoke.ai) or 'ghpages'
// (GitHub Pages project URL at invoke-ai.github.io/InvokeAI). Drive site/base from this
// so the same source can be deployed to either target.
const deployTarget = process.env.DEPLOY_TARGET ?? 'custom';
const isGhPages = deployTarget === 'ghpages';
const enableAnalytics = process.env.ENABLE_ANALYTICS === 'true';
const base = isGhPages ? '/InvokeAI' : '';
const site = isGhPages ? 'https://invoke-ai.github.io' : 'https://invoke.ai';
const redirects = createRedirects(base);
const head = createHeadConfig({ base, enableAnalytics, isGhPages, site });
// https://astro.build/config
export default defineConfig({
site,
base: base || undefined,
markdown: {
rehypePlugins: [[rehypePrefixBaseToRootLinks, { base }]],
},
integrations: [
starlight({
// Content
title: {
en: 'InvokeAI Documentation',
},
logo: {
src: './src/assets/invoke-icon-wide.svg',
alt: 'InvokeAI Logo',
replacesTitle: true,
},
favicon: 'favicon.svg',
editLink: {
baseUrl: 'https://github.com/invoke-ai/InvokeAI/edit/main/docs',
},
head,
defaultLocale: 'root',
locales: {
root: {
label: 'English',
lang: 'en',
},
},
social: socialConfig,
tableOfContents: {
maxHeadingLevel: 4,
},
customCss: [
'@fontsource-variable/inter',
'@fontsource-variable/roboto-mono',
'./src/styles/custom.css',
],
sidebar: sidebarConfig,
components: {
ThemeProvider: './src/lib/components/ForceDarkTheme.astro',
ThemeSelect: './src/lib/components/EmptyComponent.astro',
Footer: './src/lib/components/Footer.astro',
PageFrame: './src/layouts/PageFrameExtended.astro',
},
plugins: [
starlightLinksValidator({
errorOnRelativeLinks: false,
errorOnLocalLinks: false,
}),
starlightLlmsText(),
starlightChangelogs(),
starlightContextualMenu({
actions: ['copy', 'view', 'chatgpt', 'claude'],
}),
],
}),
],
redirects,
});