Archon/packages/docs-web/astro.config.mjs
Fly Lee eb730c0b82
fix(docs): prevent theme reset to dark after user switches to auto/light (#1079)
Starlight removes the `starlight-theme` localStorage key when the user
selects "auto" mode. The old init script checked that key, so every
navigation or refresh re-forced dark theme. Use a separate
`archon-theme-init` sentinel that persists across theme changes.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 10:01:27 +03:00

58 lines
1.7 KiB
JavaScript

import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
export default defineConfig({
site: 'https://archon.diy',
integrations: [
starlight({
title: 'Archon',
favicon: '/favicon.png',
logo: {
src: './src/assets/logo.png',
alt: 'Archon',
},
description: 'AI workflow engine — package your coding workflows as YAML, run them anywhere.',
head: [
{
tag: 'script',
content: `if(!localStorage.getItem('archon-theme-init')){localStorage.setItem('archon-theme-init','1');localStorage.setItem('starlight-theme','dark');document.documentElement.dataset.theme='dark';}`,
},
],
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/coleam00/Archon' }],
editLink: {
baseUrl: 'https://github.com/coleam00/Archon/edit/main/packages/docs-web/',
},
sidebar: [
{
label: 'The Book of Archon',
autogenerate: { directory: 'book' },
},
{
label: 'Getting Started',
autogenerate: { directory: 'getting-started' },
},
{
label: 'Guides',
autogenerate: { directory: 'guides' },
},
{
label: 'Adapters',
autogenerate: { directory: 'adapters' },
},
{
label: 'Deployment',
autogenerate: { directory: 'deployment' },
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
},
{
label: 'Contributing',
autogenerate: { directory: 'contributing' },
},
],
customCss: ['./src/styles/custom.css'],
}),
],
});