Ability to customize siteTitleHref in Logo
#3396
roll
started this conversation in
Feature Requests
Replies: 1 comment 1 reply
-
|
Hi @roll, the easiest way to customise it is using a route middleware currently: import { defineRouteMiddleware } from '@astrojs/starlight/route-data';
export const onRequest = defineRouteMiddleware((context) => {
// Set a custom link for the site title
context.locals.starlightRoute.siteTitleHref = 'https://example.com';
});(You can also re-use default components in overrides, but the middleware approach is probably still preferable.) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlightare you using?0.35.2
What is your idea?
Currently, it seems to be that the only way to change the link of the Logo is fully "escaping"
SiteTitlecomponent (not sure if there is a way to re-useDefault)A new
config.logo.hrefmight simplify the thingsWhy is this feature necessary?
If you have a multi-subdomain project like:
It's more natural to have logo linking always to project.dev even from subdomains (currently, it leads to a subdomain root)
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions