Pass further data to Content
#1980
Replies: 2 comments 1 reply
-
Hey @notlee! Thanks for the suggestion. We have a bigger refactor planned to move the current route data object to be more widely available, so I think we might wait for that, which would likely unlock some of this. For the locale, if you’re on the latest version of Starlight (v0.24), you should be able to access it via |
Beta Was this translation helpful? Give feedback.
-
Starting with Starlight 0.32.0, route data provides a way to read and even update all the information required to render a single page. All the properties available on route data are listed here, e.g. The route data guide explains how to access it or how to customize it. Considering these changes, I'm going to close this discussion. |
Beta Was this translation helpful? Give feedback.
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
starlight
are you using?0.23.2
What is your idea?
Hey 👋 Love Starlight, thanks for all your work on it. Would you be open to a PR which passes further Astro props through to
Content
?packages/starlight/index.astro#L19
It would be useful for us to be able to access the current locale:
But perhaps passing all Astro props could be more generally helpful?
Why is this feature necessary?
We would like to change page content conditionally based on locale within
mdx
, without duplicating content for a full page translation.Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions