-
|
I’m trying to write Typst documents in starlight using astro-typst, but I’ve encountered a problem, the file extensions recognized by starlight are hardcoded in To make Typst work, I have to modify the source code and manually add |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hey! I think currently in this case it’s easier to use Astro’s // src/content.config.ts
import { defineCollection } from 'astro:content';
- import { docsLoader } from '@astrojs/starlight/loaders';
+ import { glob } from 'astro/loaders';
import { docsSchema } from '@astrojs/starlight/schema';
export const collections = {
docs: defineCollection({
- loader: docsLoader(),
+ loader: glob({ pattern: "**/[^_]*.{typ,md,mdx}", base: "./src/content/docs" }),
schema: docsSchema()
}),
};Would be nice to make this more automatic in the future, but not sure we have the APIs from Astro to do so currently. |
Beta Was this translation helpful? Give feedback.
Hey! I think currently in this case it’s easier to use Astro’s
glob()loader directly instead of the Starlight one:// src/content.config.ts import { defineCollection } from 'astro:content'; - import { docsLoader } from '@astrojs/starlight/loaders'; + import { glob } from 'astro/loaders'; import { docsSchema } from '@astrojs/starlight/schema'; export const collections = { docs: defineCollection({ - loader: docsLoader(), + loader: glob({ pattern: "**/[^_]*.{typ,md,mdx}", base: "./src/content/docs" }), schema: docsSchema() }), };Would be nice to make this more automatic in the future, but not sure we have the APIs from Astro to do so currently.