Floating chat panel injected via Starlight Head override: - ChatWidget.astro wrapper with astro:after-swap for View Transitions - ~900-line TypeScript widget: SSE streaming, conversation persistence (localStorage), markdown rendering (marked + DOMPurify), suggestion pills, two-click delete, conversation history, rAF-throttled streaming - ~680-line CSS: dark/light themes (amber/slate palette), full-screen mobile layout with FAB/Ask button overlap fix, reduced-motion support - Three domain-specific suggestions: "Where is Jupiter right now?", "How do I predict satellite passes?", "What functions handle rise/set prediction?" - FAB uses orbit SVG icon (3 rotated ellipses + center circle) - Wired to /api/chat/stream endpoint (search backend)
179 lines
6.8 KiB
JavaScript
179 lines
6.8 KiB
JavaScript
import { defineConfig } from "astro/config";
|
|
import starlight from "@astrojs/starlight";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import remarkMath from "remark-math";
|
|
import rehypeKatex from "rehype-katex";
|
|
import mermaid from "astro-mermaid";
|
|
import icon from "astro-icon";
|
|
import opengraphImages from "astro-opengraph-images";
|
|
import { pgOrreryOgImage } from "./src/og-renderer.js";
|
|
import * as fs from "fs";
|
|
|
|
export default defineConfig({
|
|
site: "https://pg-orrery.warehack.ing",
|
|
integrations: [
|
|
icon(),
|
|
mermaid(),
|
|
starlight({
|
|
title: "pg_orrery",
|
|
description:
|
|
"It's not rocket science. A database orrery — celestial mechanics for PostgreSQL.",
|
|
favicon: "/favicon.svg",
|
|
logo: {
|
|
src: "./src/assets/pg-orrery-logo.svg",
|
|
replacesTitle: true,
|
|
},
|
|
social: [
|
|
{
|
|
icon: "github",
|
|
label: "Gitea",
|
|
href: "https://git.supported.systems/warehack.ing/pg_orrery",
|
|
},
|
|
],
|
|
customCss: [
|
|
"./src/styles/custom.css",
|
|
"./src/styles/katex-fixes.css",
|
|
"./src/styles/chat-widget.css",
|
|
"katex/dist/katex.min.css",
|
|
],
|
|
head: [
|
|
{
|
|
tag: "meta",
|
|
attrs: {
|
|
name: "theme-color",
|
|
content: "#0a0e17",
|
|
},
|
|
},
|
|
],
|
|
components: {
|
|
Head: "./src/components/Head.astro",
|
|
},
|
|
sidebar: [
|
|
{
|
|
label: "Getting Started",
|
|
items: [
|
|
{ label: "What is pg_orrery?", slug: "getting-started/what-is-pg-orrery" },
|
|
{ label: "Installation", slug: "getting-started/installation" },
|
|
{ label: "Quick Start", slug: "getting-started/quick-start" },
|
|
],
|
|
},
|
|
{
|
|
label: "Guides",
|
|
items: [
|
|
{ label: "Tracking Satellites", slug: "guides/tracking-satellites" },
|
|
{ label: "Observing the Solar System", slug: "guides/observing-solar-system" },
|
|
{ label: "Cosmic Queries Cookbook", slug: "guides/cosmic-queries" },
|
|
{ label: "Planetary Moon Tracking", slug: "guides/planetary-moons" },
|
|
{ label: "Star Catalogs in SQL", slug: "guides/star-catalogs" },
|
|
{ label: "Comet & Asteroid Tracking", slug: "guides/comets-asteroids" },
|
|
{ label: "Jupiter Radio Burst Prediction", slug: "guides/jupiter-radio-bursts" },
|
|
{ label: "Interplanetary Trajectories", slug: "guides/interplanetary-trajectories" },
|
|
{ label: "Conjunction Screening", slug: "guides/conjunction-screening" },
|
|
{ label: "JPL DE Ephemeris", slug: "guides/de-ephemeris" },
|
|
{ label: "Orbit Determination", slug: "guides/orbit-determination" },
|
|
{ label: "Satellite Pass Prediction", slug: "guides/pass-prediction" },
|
|
{ label: "Building TLE Catalogs", slug: "guides/catalog-management" },
|
|
{ label: "Rise/Set Prediction", slug: "guides/rise-set-prediction" },
|
|
{ label: "Constellation Identification", slug: "guides/constellation-identification" },
|
|
{ label: "Lagrange Equilibrium Points", slug: "guides/lagrange-equilibrium" },
|
|
],
|
|
},
|
|
{
|
|
label: "Workflow Translation",
|
|
items: [
|
|
{ label: "From Skyfield to SQL", slug: "workflow/from-skyfield" },
|
|
{ label: "From JPL Horizons to SQL", slug: "workflow/from-jpl-horizons" },
|
|
{ label: "From GMAT to SQL", slug: "workflow/from-gmat" },
|
|
{ label: "From Radio Jupiter Pro to SQL", slug: "workflow/from-radio-jupiter-pro" },
|
|
{ label: "From find_orb to SQL", slug: "workflow/from-find-orb" },
|
|
{ label: "From Poliastro to SQL", slug: "workflow/from-poliastro" },
|
|
{ label: "The SQL Advantage", slug: "workflow/sql-advantage" },
|
|
],
|
|
},
|
|
{
|
|
label: "Reference",
|
|
items: [
|
|
{ label: "Types", slug: "reference/types" },
|
|
{ label: "Functions: Satellite", slug: "reference/functions-satellite" },
|
|
{ label: "Functions: Solar System", slug: "reference/functions-solar-system" },
|
|
{ label: "Functions: Moons", slug: "reference/functions-moons" },
|
|
{ label: "Functions: Stars & Comets", slug: "reference/functions-stars-comets" },
|
|
{ label: "Functions: Radio", slug: "reference/functions-radio" },
|
|
{ label: "Functions: Transfers", slug: "reference/functions-transfers" },
|
|
{ label: "Functions: Refraction", slug: "reference/functions-refraction" },
|
|
{ label: "Functions: Rise/Set & Constellation", slug: "reference/functions-rise-set" },
|
|
{ label: "Functions: Lagrange Points", slug: "reference/functions-lagrange" },
|
|
{ label: "Functions: DE Ephemeris", slug: "reference/functions-de" },
|
|
{ label: "Functions: Orbit Determination", slug: "reference/functions-od" },
|
|
{ label: "Operators & Indexes", slug: "reference/operators-gist" },
|
|
{ label: "Body ID Reference", slug: "reference/body-ids" },
|
|
{ label: "Constants & Accuracy", slug: "reference/constants-accuracy" },
|
|
],
|
|
},
|
|
{
|
|
label: "Architecture",
|
|
items: [
|
|
{ label: "Design Principles", slug: "architecture/design-principles" },
|
|
{ label: "Constant Chain of Custody", slug: "architecture/constant-chain-of-custody" },
|
|
{ label: "Observation Pipeline", slug: "architecture/observation-pipeline" },
|
|
{ label: "Theory-to-Code Mapping", slug: "architecture/theory-to-code" },
|
|
{ label: "Memory & Thread Safety", slug: "architecture/memory-thread-safety" },
|
|
{ label: "SGP4 Integration", slug: "architecture/sgp4-integration" },
|
|
],
|
|
},
|
|
{
|
|
label: "Performance",
|
|
items: [
|
|
{ label: "Benchmarks", slug: "performance/benchmarks" },
|
|
],
|
|
},
|
|
],
|
|
}),
|
|
opengraphImages({
|
|
options: {
|
|
fonts: [
|
|
{
|
|
name: "Inter",
|
|
weight: 400,
|
|
style: "normal",
|
|
data: fs.readFileSync(
|
|
"node_modules/@fontsource/inter/files/inter-latin-400-normal.woff"
|
|
),
|
|
},
|
|
{
|
|
name: "Inter",
|
|
weight: 700,
|
|
style: "normal",
|
|
data: fs.readFileSync(
|
|
"node_modules/@fontsource/inter/files/inter-latin-700-normal.woff"
|
|
),
|
|
},
|
|
],
|
|
},
|
|
render: pgOrreryOgImage,
|
|
}),
|
|
],
|
|
|
|
markdown: {
|
|
remarkPlugins: [remarkMath],
|
|
rehypePlugins: [rehypeKatex],
|
|
},
|
|
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
server: {
|
|
host: "0.0.0.0",
|
|
...(process.env.VITE_HMR_HOST && {
|
|
hmr: {
|
|
host: process.env.VITE_HMR_HOST,
|
|
protocol: "wss",
|
|
clientPort: 443,
|
|
},
|
|
}),
|
|
},
|
|
},
|
|
|
|
telemetry: false,
|
|
devToolbar: { enabled: false },
|
|
});
|