--- interface Props { title: string; description?: string; } import { DEFAULT_THEME, themes as themeRegistry } from '../lib/themes'; import { SERVER_API_BASE } from '../lib/api'; import DesignSystemStyles from '../components/ui/DesignSystemStyles.astro'; function isEnabled(v: string | undefined): boolean { if (!v) return false; const n = v.trim().toLowerCase(); return n === '1' || n === 'true' || n === 'yes' || n === 'on'; } const { title, description = "Likwid is a modular governance engine for distributed organizations, open source communities, and civic movements." } = Astro.props; const publicDemoSite = isEnabled((globalThis as any).process?.env?.PUBLIC_DEMO_SITE); const themes = Object.fromEntries( Object.entries(themeRegistry).map(([id, t]) => [id, { isDark: t.isDark, colors: t.colors }]), ); const settingsApiBase = SERVER_API_BASE || 'http://127.0.0.1:3000'; let defaultTheme = DEFAULT_THEME; try { const res = await fetch(`${settingsApiBase}/api/settings/public`); if (res.ok) { const settings = await res.json(); if (settings && typeof settings.theme_id === 'string' && themeRegistry[settings.theme_id]) { defaultTheme = settings.theme_id; } } } catch (_e) {} const initialTheme = themeRegistry[defaultTheme] || themeRegistry[DEFAULT_THEME]; --- {title} | Likwid