Repository navigation
Expand file tree
/
Copy pathblume.config.ts
More file actions
134 lines (130 loc) · 4.17 KB
/
Copy pathblume.config.ts
File metadata and controls
134 lines (130 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import { readFileSync } from "node:fs";
import { defineConfig } from "blume";
import { posthog, script } from "blume/analytics";
import { openapi } from "blume/reference";
import { pagefind } from "blume/search";
import { redirects } from "./redirects.ts";
const deploymentBase = "/docs";
// Agent guidance for llms.txt, kept as Markdown so Vale lints it with the pages.
const llmsDetails = readFileSync(new URL("./content/_llms-preamble.md", import.meta.url), "utf8")
.replace(/^---\n[\s\S]*?\n---\n/u, "")
.trim();
const haskoy = {
name: "Haskoy",
fallback: "sans" as const,
variants: [
{
src: "./public/fonts/haskoy-latin-variable.woff2",
weight: "100..900",
},
],
};
export default defineConfig({
title: "Spacefast Docs",
description: "Publish and host the sites your agents build.",
logo: { href: "/", text: "Spacefast Docs" },
theme: {
accent: { dark: "#ff7657", light: "#d93614" },
background: { dark: "#111114", light: "#fbfaf7" },
fonts: { body: haskoy, display: haskoy, mono: haskoy },
mode: "system",
radius: "sm",
},
analytics: [
posthog({ key: "phc_pnLfu3acyQJbpNz4YYdv4ULaXgafVtUrsZT8wHwijmQT" }),
script({ src: "https://spacefast.com/cookie-banner.js", strategy: "defer" }),
script({
attributes: { type: "module" },
// Blume's search dialog prefixes the deployment base onto root-relative
// result URLs, but Pagefind defaults baseUrl to the directory it was
// loaded from (/docs/), which doubled the prefix. Keep Docs results
// base-less and make Website results absolute so Blume leaves them alone.
content: `
import("${deploymentBase}/pagefind/pagefind.js")
.then(async (pagefind) => {
await pagefind.options({
baseUrl: "/",
indexWeight: 1.15,
mergeFilter: { source: "Docs" },
});
await pagefind.mergeIndex("/pagefind", {
baseUrl: \`\${window.location.origin}/\`,
indexWeight: 1,
mergeFilter: { source: "Spacefast" },
});
})
.catch(() => undefined);
`,
}),
],
content: { root: "content" },
export: true,
github: {
owner: "spacefast",
repo: "docs",
branch: "main",
},
lastModified: "git",
markdown: { externalLinks: true, imageZoom: true, code: { icons: true, wrap: false } },
navigation: {
cta: { href: "https://my.spacefast.com", label: "Dashboard" },
featured: [
{ label: "Spacefast", href: "https://spacefast.com", icon: "house" },
{ label: "Agent setup", href: "/agents", icon: "bot" },
],
repo: true,
sidebar: { display: "group" },
tabs: [
{ label: "Docs", path: "/", icon: "book-open" },
{ label: "CLI", path: "/cli", icon: "terminal" },
{ label: "API", path: "/api", icon: "braces" },
{ label: "Agents", path: "/agents", icon: "bot" },
{ label: "Platforms", path: "/platforms", icon: "handshake" },
],
},
reference: [
openapi({
codeSamples: ["curl", "js", "python"],
sources: [
{
label: "REST API",
route: "/api/reference",
spec: "./generated/openapi/api.json",
},
{
label: "Partner API",
route: "/platforms/api/reference",
spec: "./generated/openapi/partner.json",
},
],
}),
],
search: {
provider: pagefind(),
popular: [
{ label: "Quickstart", href: "/quickstart", icon: "rocket" },
{ label: "Publishing", href: "/publish", icon: "upload" },
{ label: "MCP server", href: "/agents/mcp-server", icon: "bot" },
{ label: "API reference", href: "/api/reference", icon: "braces" },
],
},
ai: {
assistant: {
enabled: true,
endpoint: "https://api.spacefast.com/v1/docs/ask",
suggestions: [
{ label: "How do I publish a site?", icon: "upload" },
{ label: "How should an agent use Spacefast?", icon: "bot" },
{ label: "How do I roll back a version?", icon: "undo-2" },
],
},
},
agents: {
llmsTxt: { details: llmsDetails },
},
redirects,
deployment: {
site: "https://spacefast.com",
base: deploymentBase,
},
});