fix(docs): make the Starlight build pass
## Changes - Bump @astrojs/starlight to ^0.32.0 so starlight-openapi 0.13's plugin contract (top-level setup hook) is supported - Replace the no-arg docsLoader call with Astro's glob loader pointing at ../api-content so prose stays outside the Astro project tree - Rename introduction.md → index.md and update the sidebar slug so the /docs/ root resolves instead of returning 404 - Commit package-lock.json so Vercel installs deterministically ## Verification - npm run build produces 96 pages (7 narrative + 88 OpenAPI operations + 1 releases timeline) - /docs/, /docs/releases/, /docs/api-reference/operations/authlogin/ and every other route return 200 locally - 14 release cards render with the brand-green "Latest" badge on v3.7.1
This commit is contained in:
1 parent
e69f40fdd0
commit
0d25973efb
5 files changed
+7997
-4
No files matched your search
File renamed without changes.
@@ -42,7 +42,7 @@ export default defineConfig({
|
|||||||
{
|
{
|
||||||
label: "Getting started",
|
label: "Getting started",
|
||||||
items: [
|
items: [
|
||||||
{ label: "Introduction", slug: "introduction" },
|
{ label: "Introduction", slug: "" },
|
||||||
{ label: "Quickstart", slug: "quickstart" },
|
{ label: "Quickstart", slug: "quickstart" },
|
||||||
{ label: "Authentication", slug: "authentication" },
|
{ label: "Authentication", slug: "authentication" },
|
||||||
],
|
],
|
||||||
|
|||||||
Generated
+7983
File diff suppressed because it is too large.
Load diff
@@ -12,7 +12,7 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/starlight": "^0.30.0",
|
"@astrojs/starlight": "^0.32.0",
|
||||||
"astro": "^5.0.0",
|
"astro": "^5.0.0",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "^0.33.5",
|
||||||
"starlight-openapi": "^0.13.0"
|
"starlight-openapi": "^0.13.0"
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
import { defineCollection } from "astro:content";
|
import { defineCollection } from "astro:content";
|
||||||
import { docsLoader } from "@astrojs/starlight/loaders";
|
import { glob } from "astro/loaders";
|
||||||
import { docsSchema } from "@astrojs/starlight/schema";
|
import { docsSchema } from "@astrojs/starlight/schema";
|
||||||
|
|
||||||
// Load markdown from a sibling folder so prose lives outside the Astro
|
// Load markdown from a sibling folder so prose lives outside the Astro
|
||||||
// project tree. Contributors edit /docs/api-content/*.md without touching
|
// project tree. Contributors edit /docs/api-content/*.md without touching
|
||||||
// the build tool.
|
// the build tool.
|
||||||
|
//
|
||||||
|
// Starlight's built-in docsLoader is hardcoded to src/content/docs/, so we
|
||||||
|
// use Astro's plain glob loader with a custom base and apply Starlight's
|
||||||
|
// schema on top. The collection name must remain "docs" — Starlight looks
|
||||||
|
// it up by that exact name.
|
||||||
export const collections = {
|
export const collections = {
|
||||||
docs: defineCollection({
|
docs: defineCollection({
|
||||||
loader: docsLoader({ base: "../api-content" }),
|
loader: glob({
|
||||||
|
base: "../api-content",
|
||||||
|
// README is contributor-facing docs (how to build the site),
|
||||||
|
// not part of the published content.
|
||||||
|
pattern: ["**/[^_]*.{md,mdx}", "!README.md"],
|
||||||
|
}),
|
||||||
schema: docsSchema(),
|
schema: docsSchema(),
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user