Skip to content

Instantly share code, notes, and snippets.

@Ellisande
Created June 25, 2025 18:02
Show Gist options
  • Save Ellisande/4fa6fd8f56e5090c4f1fe18394da8a74 to your computer and use it in GitHub Desktop.
Save Ellisande/4fa6fd8f56e5090c4f1fe18394da8a74 to your computer and use it in GitHub Desktop.
// @ts-check
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightOpenAPI, { openAPISidebarGroups } from "starlight-openapi";
const schemaUrl =
process.env.NODE_ENV === "production"
? "https://demo.api.string-theory.finance/api"
: "http://localhost:8000/api";
// https://astro.build/config
export default defineConfig({
server: {
port: 5000,
},
integrations: [
starlight({
customCss: ["./src/styles/theme.css"],
title: "String Theory",
social: [],
favicon: "favicon.svg",
plugins: [
// Generate the OpenAPI documentation pages.
starlightOpenAPI([
{
base: "api",
schema: schemaUrl,
sidebar: {
label: "API",
operations: {
labels: "operationId",
sort: "document",
},
},
},
]),
],
sidebar: [
{
label: "Blog",
items: [
{
label: "The Attribution Problem",
link: "/blog/attribution-problem",
},
{
label: "Deterministic Attribution",
link: "/blog/deterministic-attribution",
},
{
label: "The Single Context Problem",
link: "/blog/single-context-problem",
},
{
label: "Sticky Context",
link: "/blog/sticky-context",
},
{
label: "The Zero Sum Fallacy",
link: "/blog/zero-sum",
},
],
},
{
label: "Concepts",
autogenerate: { directory: "concepts" },
},
...openAPISidebarGroups,
],
}),
],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment