starlight-blog icon indicating copy to clipboard operation
starlight-blog copied to clipboard

Blog doesn't work with custom loaders

Open rambleraptor opened this issue 3 months ago • 1 comments

Describe the bug

I've replaced the Starlight docsLoader with my own loader so that I can put content in a different directory than src/content/docs. It looks like getBlogEntries hardcodes the src/content/docs path, so my custom loader breaks the plugin entirely.

To Reproduce

  1. Create a Starlight with blog
  2. Add a blog post
  3. Move the content of src/content/docs (which includes the blog/ folder) to a different folder.
  4. Create a content collection called docs that loads from that different folder.

Expected behavior

Blog files should be picked up.

How often does this bug happen?

Every time

System Info

No response

Additional Context

No response

rambleraptor avatar Sep 11 '25 03:09 rambleraptor

Thanks for the feedback :raised_hands:

Small question: is the custom loader only used to have content located in a different directory? Is such loader available publicly to take a look at the implementation?

As this is not a natively supported feature of the Starlight docs loader for the time being (due to an Astro limitation), most plugins do the same at the moment until the limitation is lifted and Starlight supports custom directories natively in its docs loader.

HiDeoo avatar Sep 17 '25 14:09 HiDeoo