#2918790c000 Thanks @HiDeoo! - Fixes a trailing slash inconsistency in generated sidebar links when using the trailingSlash: 'ignore' Astro option (the default) between internal and auto-generated links. Starlight behavior for this configuration value is to use a trailing slash as many common hosting providers redirect to URLs with a trailing slash by default.
#2390f493361 Thanks @delucis! - Moves route data to Astro.locals instead of passing it down via component props
⚠️ Breaking change:
Previously, all of Starlight’s templating components, including user or plugin overrides, had access to a data object for the current route via Astro.props.
This data is now available as Astro.locals.starlightRoute instead.
To update, refactor any component overrides you have:
Remove imports of @astrojs/starlight/props, which is now deprecated.
Update code that accesses Astro.props to use Astro.locals.starlightRoute instead.
Remove any spreading of {...Astro.props} into child components, which is no longer required.
In the following example, a custom override for Starlight’s LastUpdated component is updated for the new style:
---
import Default from '@astrojs/starlight/components/LastUpdated.astro';
import type { Props } from '@astrojs/starlight/props';
const updatedThisYear = lastUpdated?.getFullYear() === new Date().getFullYear();
---
{updatedThisYear && (
<Default {...Astro.props}><slot /></Default>
<Default><slot /></Default>
)}
Community Starlight plugins may also need to be manually updated to work with Starlight 0.32. If you encounter any issues, please reach out to the plugin author to see if it is a known issue or if an updated version is being worked on.
#2578f895f75 Thanks @HiDeoo! - Deprecates the Starlight plugin setup hook in favor of the new config:setup hook which provides the same functionality.
⚠️ BREAKING CHANGE:
The Starlight plugin setup hook is now deprecated and will be removed in a future release. Please update your plugins to use the new config:setup hook instead.
export default {
name: 'plugin-with-translations',
hooks: {
'setup'({ config }) {
'config:setup'({ config }) {
// Your plugin configuration setup code
},
},
};
#2578f895f75 Thanks @HiDeoo! - Exposes the built-in localization system in the Starlight plugin config:setup hook.
⚠️ BREAKING CHANGE:
This addition changes how Starlight plugins add or update translation strings used in Starlight’s localization APIs.
Plugins previously using the injectTranslations() callback function from the plugin config:setup hook should now use the same function available in the i18n:setup hook.
export default {
name: 'plugin-with-translations',
hooks: {
'config:setup'({ injectTranslations }) {
'i18n:setup'({ injectTranslations }) {
injectTranslations({
en: {
'myPlugin.doThing': 'Do the thing',
},
fr: {
'myPlugin.doThing': 'Faire le truc',
},
});
},
},
};
#28582df9d05 Thanks @XREvo! - Adds support for Pagefind’s multisite search features
#2578f895f75 Thanks @HiDeoo! - Adds a new useTranslations() callback function to the Starlight plugin config:setup hook to generate a utility function to access UI strings for a given language.
#2578f895f75 Thanks @HiDeoo! - Adds a new absolutePathToLang() callback function to the Starlight plugin config:setup to get the language for a given absolute file path.
#277788f4214 Thanks @hippotastic! - Updates astro-expressive-code dependency to the latest version (0.40).
This includes an update to the latest Shiki version (1.26.1), providing access to all current Shiki themes and syntax highlighting languages, and adding the config options shiki.engine, shiki.bundledLangs, shiki.langAlias and removeUnusedThemes. It also adds new style variants to the optional collapsible sections plugin.
#273629a885b Thanks @delucis! - ⚠️ BREAKING CHANGE: The minimum supported version of Astro is now 5.1.5
Please update Astro and Starlight together:
Terminal window
npx@astrojs/upgrade
#2728e187383 Thanks @delucis! - Updates minimum Pagefind dependency to v1.3.0, sets new defaults for Pagefind’s ranking options, and adds support for manually configuring the ranking options
The new ranking option defaults have been evaluated against Starlight’s own docs to improve the quality of search results. See “Customize Pagefind’s result ranking” for more details about how they work.
#15723bf960 Thanks @tony-sull! - Adds a print stylesheet to improve the appearance of Starlight docs pages when printed
#2728e187383 Thanks @delucis! - Fixes Pagefind logging to respect the Astro log level. When using Astro’s --verbose or --silent CLI flags, these are now respected by Pagefind as well.
🐞 Patch Changes
#2792412effb Thanks @dhruvkb! - Uses semantic var(--sl-color-hairline) for the page sidebar border instead of var(--sl-color-gray-6). This is visually the same as previously but makes it easier to override the hairline color consistently across a site.
#273629a885b Thanks @delucis! - Updates internal dependencies @astrojs/sitemap and @astrojs/mdx to the latest versions
#2782d9d415b Thanks @delucis! - Fixes a documentation link in the JSDoc comment for the StarlightExpressiveCodeOptions type
#2635ec4b851 Thanks @HiDeoo! - Fixes an issue where the language picker in multilingual sites could display the wrong language when navigating between pages with the browser back/forward buttons.
#270202d16f3 Thanks @HiDeoo! - Fixes an issue with autogenerated sidebars when using Starlight with Astro’s new Content Layer API with directories containing spaces or special characters.
#2704fd16470 Thanks @delucis! - Fixes display of focus indicator around site title
#26885c6996c Thanks @HiDeoo! - Fixes an issue with autogenerated sidebars when using Starlight with Astro’s new Content Layer API where group names would be sluggified.
#26128d5a4e8 Thanks @HiDeoo! - Adds support for Astro v5, drops support for Astro v4.
Upgrade Astro and dependencies
⚠️ BREAKING CHANGE: Astro v4 is no longer supported. Make sure you update Astro and any other official integrations at the same time as updating Starlight:
Terminal window
npx@astrojs/upgrade
Community Starlight plugins and Astro integrations may also need to be manually updated to work with Astro v5. If you encounter any issues, please reach out to the plugin or integration author to see if it is a known issue or if an updated version is being worked on.
Update your collections
⚠️ BREAKING CHANGE: Starlight’s internal content collections, which organize, validate, and render your content, have been updated to use Astro’s new Content Layer API and require configuration changes in your project.
Move the content config file. This file no longer lives within the src/content/config.ts folder and should now exist at src/content.config.ts.
Edit the collection definition(s). To update the docs collection, a loader is now required:
src/content.config.ts
import { defineCollection } from "astro:content";
import { docsLoader } from "@astrojs/starlight/loaders";
import { docsSchema } from "@astrojs/starlight/schema";
If you are using the i18n collection to provide translations for additional languages you support or override our default labels, you will need to update the collection definition in a similar way and remove the collection type which is no longer available:
src/content.config.ts
import { defineCollection } from "astro:content";
import { docsLoader, i18nLoader } from "@astrojs/starlight/loaders";
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema";
Update other collections. To update any other collections you may have, follow the “Updating existing collections” section in the Astro 5 upgrade guide.
If you are unable to make any changes to your collections at this time, including Starlight’s default docs and i18n collections, you can enable the legacy.collections flag to upgrade to v5 without updating your collections. This legacy flag exists to provide temporary backwards compatibility, and will allow you to keep your collections in their current state until the legacy flag is no longer supported.
#266462ff007 Thanks @HiDeoo! - Publishes provenance containing verifiable data to link a package back to its source repository and the specific build instructions used to publish it.
#2616128cc51 Thanks @delucis! - Fixes an edge case to correctly avoid a trailing slash when navigating from a root locale homepage to another language via Starlight’s language switcher when trailingSlash: 'never' is set
#26116059d96 Thanks @HiDeoo! - Fixes a UI string type issue in projects with multiple data content collections.
#260610b15a7 Thanks @delucis! - Makes <CardGrid> more resilient to complex child content on smaller viewports
#2605ec7ab4f Thanks @brianzelip! - Exposes SidebarPersister component in package exports for use in custom overrides
#26149a31980 Thanks @HiDeoo! - Fixes an issue with custom pages using the <StarlightPage /> component and a custom sidebar missing highlighting for the active page and navigation links.
#2551154c8e3 Thanks @hippotastic! - Updates the astro-expressive-code dependency to the latest version (0.38).
The new version allows using ec.config.mjs to selectively override individual Expressive Code styles and settings provided by Starlight themes and plugins, speeds up Shiki language loading, and adds the config option expressiveCode.shiki.injectLangsIntoNestedCodeBlocks. See the Expressive Code release notes for full details.
#22526116db0 Thanks @HiDeoo! - Improves build performance for sites with large sidebars
This release adds a caching layer to Starlight’s sidebar generation logic, reducing the number of times sidebars need to be regenerated while building a site. Some benchmarks for projects with a complex sidebar saw builds complete more than 35% faster with this change.
#2503a4c8edd Thanks @HiDeoo! - Improves the accessibility of asides and tabs by removing some unnecessary HTML landmarks.
#2546bf42300 Thanks @HiDeoo! - Fixes an issue where i18n content collection related errors, e.g. malformed JSON or YAML, would not be reported.
#254807673c8 Thanks @HiDeoo! - Fixes a URL localization edge case. In projects without a root locale configured, slugs without a locale prefix did not fall back to the default locale as expected.
#254791e1dd7 Thanks @HiDeoo! - Fixes a Firefox Markdown content rendering issue for text sentences separated by a line break.
#25241b46783 Thanks @jsparkdev! - Fixes a broken link to Astro’s Docs in an error message