Skip to content

Commit aec7664

Browse files
committed
fix(web/starlight): add content.config.ts with explicit glob loader
Astro 5 Content Layer requires an explicit collection config. Starlight's built-in docsLoader() resolves the base path without a './' prefix, which Astro's glob loader doesn't handle correctly in our pnpm monorepo — the collection ends up empty and only 404.html gets generated. Using astro/loaders glob directly with base './src/content/docs' restores index.html generation for both guides and api sites.
1 parent 43263eb commit aec7664

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineCollection } from 'astro:content';
2+
import { docsSchema } from '@astrojs/starlight/schema';
3+
import { glob } from 'astro/loaders';
4+
5+
export const collections = {
6+
docs: defineCollection({
7+
loader: glob({ base: './src/content/docs', pattern: '**/[^_]*.{md,mdx}' }),
8+
schema: docsSchema(),
9+
}),
10+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineCollection } from 'astro:content';
2+
import { docsSchema } from '@astrojs/starlight/schema';
3+
import { glob } from 'astro/loaders';
4+
5+
export const collections = {
6+
docs: defineCollection({
7+
loader: glob({ base: './src/content/docs', pattern: '**/[^_]*.{md,mdx}' }),
8+
schema: docsSchema(),
9+
}),
10+
};

0 commit comments

Comments
 (0)