You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/manual-setup.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ Find all available options in the [Starlight configuration reference](/reference
64
64
65
65
Starlight is built on top of Astro’s [content collections](https://docs.astro.build/en/guides/content-collections/), which are configured in the `src/content.config.ts` file.
66
66
67
-
Create or update the content config file, adding a `docs` collection that uses Starlight’s `docsLoader` and `docsSchema`:
67
+
Create or update the content config file, adding a `docs` collection that uses Starlight’s [`docsLoader`](/reference/configuration/#docsloader) and [`docsSchema`](/reference/configuration/#docsschema):
Starlight exports the following [Astro loaders](https://docs.astro.build/en/reference/content-loader-reference/) from the `@astrojs/starlight/loaders` module to simplify configuring content collections.
702
+
703
+
#### `docsLoader()`
704
+
705
+
The `docsLoader()` loads local Markdown, MDX, and Markdoc files from the `src/content/docs/` directory.
706
+
File names starting with an underscore (`_`) are ignored.
By default, pages generated using `docsLoader()` process your file names using a sluggifier, which removes special characters and lowercases the file name.
721
+
If you want to override this default, provide your own custom `generateId()` function.
722
+
723
+
For example, this can be useful to preserve special characters that would be removed.
724
+
By default, `Example.File.md` would be served at `/examplefile`.
725
+
If you wanted to serve it at `/Example.File`, you could do so by defining a custom `generateId()` function:
726
+
727
+
```js
728
+
docsLoader({
729
+
// Remove the `.md` or `.mdx` extension, but otherwise don’t process filenames.
There are currently no options to configure `i18nLoader()`.
750
+
751
+
### Schemas
752
+
753
+
Starlight provides the following [content collection schemas](https://docs.astro.build/en/guides/content-collections/#defining-the-collection-schema) from the `@astrojs/starlight/schema` module.
754
+
These schemas must be used for the `docs` and `i18n` collections Starlight depends on.
755
+
756
+
#### `docsSchema()`
757
+
758
+
The `docsSchema()` parses frontmatter for all your content in the `docs` collection.
0 commit comments