HiDeoo / starlight-blog

Starlight plugin to add a blog to your documentation
https://starlight-blog-docs.vercel.app
MIT License
106 stars 10 forks source link

Co-exist with starlight documentation #16

Closed brettstack closed 7 months ago

brettstack commented 7 months ago

Is your feature request related to a problem?

I have starlight docs page that lives at /docs on my website. I'd love to also have a /blog route that uses this package but I wasn't able to get the two to co-exist.

Describe the solution you'd like

Do you know if it's possible or how difficult this would be to support?

Describe alternatives you've considered

No response

Additional Context

No response

HiDeoo commented 7 months ago

Thanks for your feedback.

Are you using something like the "Use Starlight at a subpath" guide (and your docs are in a src/content/docs/docs/ directory? Or some other setup?

brettstack commented 7 months ago

Yes that's correct. I tried adding the blog to src/content/docs/blog as well as src/content/blog/blog and had issues with both. I didn't expect it to work since starlight-blog overrides some components so I figured it would mess with the docs.

HiDeoo commented 7 months ago

Thanks for the details.

I'll have to play with this setup a bit when I get the time as this is not one I have played a lot with but without checking, I would imagine this is something we can support.

HiDeoo commented 7 months ago

I setup a repro in a StackBlitz using the following steps:

  1. Start from a fresh Astro installation
  2. Add Starlight to an existing Astro site
  3. Setup Starlight at a docs subpath
  4. Install starlight-blog

And everything worked out of the box for me. Here is the link to the StackBlitz.

Maybe the StackBlitz can help you figure out if this is a configuration issue on your end or if you are still encountering issues, would you mind providing a repro?

brettstack commented 7 months ago

Thanks so much! I'll check it out and report back

brettstack commented 7 months ago

It worked! I think what I did before was injecting a step that wasn't necessary and broke it. Amazing! Thanks @HiDeoo

HiDeoo commented 7 months ago

Thanks for taking the time to check it out, really appreciate it!