-
I'll be moving a Starlight implementation from its own domain to be proxied under a main domain (from a Nextjs site). I'm hoping to get some insight into best practice around links and image URLs and keeping them easy to maintain and run locally from the Starlight repository, but also have them work from the proxy. The proxy is maindomain.com/docs/ -> Starlight All links when run under the proxy need to be at Would love any insights or best practices |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hi @brob — good question! I think for a case like this I would recommend setting Astro’s import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
export default defineConfig({
base: '/docs/',
integrations: [
starlight({
title: 'My delightful docs site',
}),
],
}); This will apply in both cases, so when running the local project everything will also be prefixed with
What Astro/Starlight don’t take care of automatically are links inside your content. For example, if you have some Markdown like this: Check out [our deployment guide](/deploy/) for more details. We can’t really safely assume you mean That said, given you’re moving an existing code base that could be a bit of a pain, so one option could be to add a small remark plugin which processes all links and injects the base automatically. Edit: Ah, and one thing that sometimes trips people up: |
Beta Was this translation helpful? Give feedback.
Hi @brob — good question!
I think for a case like this I would recommend setting Astro’s
base
config option to the proxied path, so something like:This will apply in both cases, so when running the local project everything will also be prefixed with
/docs/
. I wasn’t clear from the description if that would be an issue. If it’s only for local development, I guess it wouldn’t be an issue if you need to navigate to/docs/
instead of/
to see the site.base
will take…