#3058274cc06 Thanks @techfg! - Fixes display of focus indicator around site title
#3181449c822 Thanks @HiDeoo! - Fixes an issue where all headings in Markdown and MDX content were rendered with a clickable anchor link, even in non-Starlight pages.
#3168ca693fe Thanks @jsparkdev! - Updates Korean langage support with improvements and missing translations
#3153ea31f46 Thanks @SuperKXT! - Fixes hover styles for highlighted directory in FileTree component.
#2905b5232bc Thanks @HiDeoo! - Fixes a potential issue for projects with dynamic routes added by an user, an Astro integration, or a Starlight plugin where some styles could end up being missing.
#316580a7871 Thanks @KianNH! - Increases maxBuffer for an internal spawnSync() call to support larger Git commit histories when using Starlight’s lastUpdated feature.
This change allows for easier customization of Starlight’s CSS as any custom unlayered CSS will override the default styles. If you are using cascade layers in your custom CSS, you can use the @layer CSS at-rule to define the order of precedence for different layers including the ones used by Starlight.
We recommend checking your site’s appearance when upgrading to make sure there are no style regressions caused by this change.
#31223a087d8 Thanks @delucis! - Removes default attrs and content values from head entries parsed using Starlight’s schema.
Previously when adding head metadata via frontmatter or user config, Starlight would automatically add values for attrs and content if not provided. Now, these properties are left undefined.
This makes it simpler to add tags in route middleware for example as you no longer need to provide empty values for attrs and content:
This is mostly an internal API but if you are overriding Starlight’s Head component or processing head entries in some way, you may wish to double check your handling of Astro.locals.starlightRoute.head is compatible with attrs and content potentially being undefined.
#30338c19678 Thanks @delucis! - Adds support for generating clickable anchor links for headings.
By default, Starlight now renders an anchor link beside headings in Markdown and MDX content. A new <AnchorHeading> component is available to achieve the same thing in custom pages built using <StarlightPage>.
If you want to disable this new Markdown processing set the markdown.headingLinks option in your Starlight config to false:
starlight({
title: 'My docs',
markdown: {
headingLinks: false,
},
}),
⚠️ BREAKING CHANGE: The minimum supported version of Astro is now v5.5.0.
Previously, Starlight used to automatically provide a fallback theme for Shiki, the default syntax highlighter built into Astro if the configured Shiki theme was not github-dark.
This fallback was only relevant when the default Starlight code block renderer, Expressive Code, was disabled and Shiki was used. Starlight no longer provides this fallback.
If you were relying on this behavior, you now manually need to update your Astro configuration to use the Shiki css-variables theme to match the previous behavior.
import { defineConfig } from 'astro/config';
export default defineConfig({
markdown: {
shikiConfig: {
theme: 'css-variables',
},
},
});
Additionally, you can use custom CSS to control the appearance of the code blocks. Here are the previously used CSS variables for the fallback theme:
#30881885049 Thanks @HiDeoo! - Fixes a regression in Starlight version 0.33.0 that caused the description and links to language alternates for multilingual websites to be missing from the <head> of the page.
#3065463adf5 Thanks @HiDeoo! - Updates the social configuration option TSDoc example to match the shape of the expected value.
#302682deb84 Thanks @HiDeoo! - Fixes a potential list styling issue if the last element of a list item is a <script> tag.
⚠️ BREAKING CHANGE:
This release drops official support for Chromium-based browsers prior to version 105 (released 30 August 2022) and Firefox-based browsers prior to version 121 (released 19 December 2023). You can find a list of currently supported browsers and their versions using this browserslist query.
With this release, Starlight-generated sites will still work fine on those older browsers except for this small detail in list item styling, but future releases may introduce further breaking changes for impacted browsers, including in patch releases.
⚠️ BREAKING CHANGE: The social configuration option has changed syntax. You will need to update this in astro.config.mjs when upgrading.
Previously, a limited set of platforms were supported using a shorthand syntax with labels built in to Starlight. While convenient, this approach was less flexible and required dedicated code for each social platform added.
Now, you must specify the icon and label for each social link explicitly and you can use any of Starlight’s built-in icons for social links.
The following example shows updating the old social syntax to the new:
#2927c46904c Thanks @HiDeoo! - Adds the head route data property which contains an array of all tags to include in the <head> of the current page.
Previously, the <Head> component was responsible for generating a list of tags to include in the <head> of the current page and rendering them.
This data is now available as Astro.locals.starlightRoute.head instead and can be modified using route data middleware.
The <Head> component now only renders the tags provided in Astro.locals.starlightRoute.head.
#29246a56d1b Thanks @HiDeoo! - ⚠️ BREAKING CHANGE: Ensures that the <Badge> and <Icon> components no longer render with a trailing space.
In Astro, components that include styles render with a trailing space which can prevent some use cases from working as expected, e.g. when using such components inlined with text. This change ensures that the <Badge> and <Icon> components no longer render with a trailing space.
If you were previously relying on that implementation detail, you may need to update your code to account for this change. For example, considering the following code:
<Badgetext="New" />
Feature
The rendered text would previously include a space between the badge and the text due to the trailing space automatically added by the component:
New Feature
Such code will now render the badge and text without a space:
NewFeature
To fix this, you can add a space between the badge and the text:
<Badge text="New" />Feature
<Badge text="New" /> Feature
#27277c8fa30 Thanks @techfg! - Updates mobile menu toggle styles to display a close icon while the menu is open
#3025f87e9ac Thanks @delucis! - Fixes Starlight’s autogenerated <meta name="twitter:site"> tags when a Twitter link is set in social config. Previously these incorrectly rendered content="/username" and now correctly render content="@username".
#30305bdf139 Thanks @trueberryless! - Updates the type of the isFallback field in route data from true to boolean, keeping it optional but allowing false as a possible value.
#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
#19235269aad Thanks @HiDeoo! - Overhauls the built-in localization system which is now powered by the i18next library and available to use anywhere in your documentation website.
See the “Using UI translations” guide to learn more about how to access built-in UI labels or your own custom strings in your project. Plugin authors can also use the new injectTranslations() helper to add or update translation strings.
⚠️ BREAKING CHANGE: The Astro.props.labels props has been removed from the props passed down to custom component overrides.
If you are relying on Astro.props.labels (for example to read a built-in UI label), you will need to update your code to use the new Astro.locals.t() helper instead.
#12556f3202b Thanks @Fryuni! - Adds support for server-rendered Starlight pages.
When building a project with hybrid or server output mode, a new prerender option on Starlight config can be set to false to make all Starlight pages be rendered on-demand:
exportdefaultdefineConfig({
output: 'server',
integrations: [
starlight({
prerender: false,
}),
],
});
🐞 Patch Changes
#2242756e85e Thanks @delucis! - Refactors the logic for persisting and restoring sidebar state across navigations for better performance on slow or busy devices
#12556f3202b Thanks @Fryuni! - Improves performance of computing the last updated times from Git history.
Instead of executing git for each docs page, it is now executed twice regardless of the number of pages.
#12556f3202b Thanks @Fryuni! - Fixes last updated times on projects with custom srcDir
#22815062d30 Thanks @HiDeoo! - Fixes a potential text rendering issue that could include extra whitespaces for text containing colons.
#227962d59e2 Thanks @HiDeoo! - Fixes an issue with frontmatter schemas containing collection references used with the <StarlightPage /> component and an Astro version greater than 4.14.0.
#178468f56a7 Thanks @HiDeoo! - Adds <LinkButton> component for visually distinct and emphasized call to action links
#21509368494 Thanks @delucis! - Adds state persistence across page navigations to the main site sidebar
#2087caa84ea Thanks @HiDeoo! - Adds persistence to synced <Tabs> so that a user’s choices are reflected across page navigations.
#2051ec3b579 Thanks @HiDeoo! - Adds a guideline to the last step of the <Steps> component.
If you want to preserve the previous behaviour and hide the guideline on final steps, you can add the following custom CSS to your site:
/* Hide the guideline for the final step in <Steps> lists. */
.sl-steps>li:last-of-type::after {
background: transparent;
}
#178468f56a7 Thanks @HiDeoo! - Changes the hero component action button default variant from minimal to primary.
⚠️ BREAKING CHANGE: If you want to preserve the previous appearance, hero component action buttons previously declared without a variant will need to be updated to include the variant property with the value minimal.
hero:
actions:
- text: View on GitHub
link: https://github.com/astronaut/my-project
icon: external
variant: minimal
#2168e044fee Thanks @HiDeoo! - ⚠️ BREAKING CHANGE: Updates the <StarlightPage /> component sidebar prop to accept an array of SidebarItems like the main Starlight sidebar configuration in astro.config.mjs.
This change simplifies the definition of sidebar items in the <StarlightPage /> component, allows for shared sidebar configuration between the global sidebar option and <StarlightPage /> component, and also enables the usage of autogenerated sidebar groups with the <StarlightPage /> component.
If you are using the <StarlightPage /> component with a custom sidebar configuration, you will need to update the sidebar prop to an array of SidebarItem objects.
For example, the following custom page with a custom sidebar configuration defines a “Resources” group with a “New” badge, a link to the “Showcase” page which is part of the docs content collection, and a link to the Starlight website:
#21540b381d5 Thanks @mktbsh! - Updates <head> logic to deduplicate <link rel="canonical"> tags. This means that custom canonicals set via frontmatter now override the default canonical generated by Starlight.
#21576757d97 Thanks @astrobot-houston! - Updates file tree icon mapping to correctly map .cjs and .mjs extensions in several contexts
#2156904ad47 Thanks @delucis! - Fixes builds for projects with a space in their pathname
#2122359a642 Thanks @HiDeoo! - Fixes an i18n configuration issue for multilingual sites when using Astro’s i18n config with prefixDefaultLocale set to false.
#210581f8a2c Thanks @delucis! - Fixes an edge case in custom pagination link processing
Custom link values for prev/next in page frontmatter are now always used as authored.
Previously this was not the case in some edge cases such as for the first and final pages in the sidebar.
#2119464685a Thanks @evadecker! - Improves styling of <hr>, <blockquote>, and <code> within asides
⚠️ Potentially breaking change: The search.shortcutLabel UI string has been removed. If you were using this string in your custom UI, you will need to update your code.
#2064c5b47cb Thanks @SnowDingo! - Improves styling of Markdown tables to work better in different contexts, including against different background colours like when used in asides.
#20312bab648 Thanks @delucis! - Makes sidebar entry parsing stricter in Starlight config
⚠️ Potentially breaking change: Previously Starlight would accept a sidebar entry that matched one of its expected shapes, even if it included additional properties. For example, including both link and items was considered valid, with items being ignored. Now, it is an error to include more than one of link, items, or autogenerate in a sidebar entry.
If you see errors after updating, look for sidebar entries in the Starlight configuration in astro.config.mjs that include too many keys and remove the one that was previously ignored.
#1874eeba06e Thanks @lorenzolewis! - Adds a new syntax for specifying sidebar link items for internal links
You can now specify an internal page using only its slug, either as a string, or as an object with a slug property:
#1841ee0cd38a Thanks @HiDeoo! - Adds support for Astro.currentLocale and Astro’s i18n routing.
⚠️ Potentially breaking change: Starlight now configures Astro’s i18n option for you based on its locales config.
If you are currently using Astro’s i18n option as well as Starlight’s locales option, you will need to remove one of these.
In general we recommend using Starlight’s locales, but if you have a more advanced configuration you may choose to keep Astro’s i18n config instead.
#1958081d1a96 Thanks @delucis! - Allows users to opt into displaying a “Built with Starlight” link in the site footer
#18462de67039 Thanks @delucis! - Updates @astrojs/mdx to v3 and enables MDX optimization by default
⚠️ Potentially breaking change: MDX optimization speeds up builds (Starlight’s docs are building ~40% faster for example), but restricts some advanced MDX features. See full details in the MDX optimization documentation.
Most Starlight users should be unaffected, but if you are using MDX files outside of Starlight pages with the components prop, you may see issues. You can disable optimization by adding MDX manually to your integrations array in astro.config.mjs:
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import starlight from '@astrojs/starlight';
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: 'My docs',
// ...
}),
mdx(),
],
});
#17351a9ab50d Thanks @HiDeoo! - Adds custom styles for <details> and <summary> elements in Markdown content.
#18462de67039 Thanks @delucis! - ⚠️ BREAKING CHANGE: The minimum supported version of Astro is now 4.8.6
#1842c7838636 Thanks @delucis! - Moves the href used in the site title link to Starlight’s route data object. This makes it possible for overrides to change the title link while reusing Starlight’s default component implemenation.
⚠️ Potentially breaking change: The shape of the title field on Starlight’s internal config object has changed. This used to be a string, but is now an object.
If you are relying on config.title (for example in a custom <SiteTitle> or <Head> component), you will need to update your code. We recommend using the new siteTitle prop available to component overrides:
#161361493e55 Thanks @HiDeoo! - Adds new draft frontmatter option to exclude a page from production builds.
#6407dc503ea Thanks @HiDeoo! - Updates the default line-height from 1.8 to 1.75. This change avoids having a line height with a fractional part which can cause scripts accessing dimensions involving the line height to get an inconsistent rounded value in various browsers.
If you want to preserve the previous line-height, you can add the following custom CSS to your site:
:root {
--sl-line-height: 1.8;
}
#1720749ddf85 Thanks @jacobdalamb! - Updates astro-expressive-code dependency to the latest minor release (0.35) and exposes a new @astrojs/starlight/expressive-code/hast module for users who need to use Expressive Code’s version of hast.
This includes a potentially breaking change if you use custom Expressive Code plugins. See the Expressive Code release notes for full details.
#178565009c9c Thanks @dreyfus92! - Adds 5 new icons: node, cloudflare, vercel, netlify and deno
#1786d05d693a Thanks @delucis! - Fixes type inference for i18n strings added by extending the default schema
#17776949404b Thanks @HiDeoo! - Fixes an issue where TypeScript could fail to serialize the frontmatter schema when configured to emit declaration files
#17344493dcfa Thanks @delucis! - Refactors <ThemeSelect> custom element logic to improve performance
#1731f08b0dff Thanks @techfg! - Fixes responding to system color scheme changes when theme is auto
#1709c5cd1811 Thanks @HiDeoo! - Fixes a UI strings translation issue for sites configured with a single non-root language different from English.
#17233b29b3ab Thanks @OliverSpeir! - Fixes accessibility by using aria-selected="false" for inactive tabs instead of removing aria-selected="true" in the tablist of Starlight’s <Tabs> component
#159613ed30cd Thanks @HiDeoo! - Adds support for toggling the built-in search modal using the Ctrl+k keyboard shortcut.
#16084096e1b7 Thanks @HiDeoo! - Removes nested CSS from the <FileTree> component to prevent a potential warning when using Tailwind CSS.
#162667459cb4 Thanks @hippotastic! - Fixes a bundling issue that caused imports from @astrojs/starlight/components to fail when using the config setting expressiveCode: false.
#15685f99a71d Thanks @HiDeoo! - Adds support for optionally setting an icon on a <TabItem> component to make it easier to visually distinguish between tabs.
#13089a918a5b Thanks @HiDeoo! - Adds <FileTree> component to display the structure of a directory.
#15411043052f Thanks @hippotastic! - Updates astro-expressive-code dependency to the latest minor release (0.33).
This unlocks support for word wrap and line numbers, as well as updating the syntax highlighter to the latest Shiki release, which includes new and updated language grammars.
#14612e17880 Thanks @liruifengv! - Improves the table of contents title translation in Simplified Chinese
#14624741ccc Thanks @delucis! - Fixes overflow of very long site titles on narrow viewports
#14599a8e0ec Thanks @delucis! - Fixes a bug where table of contents highlighting could break given very specific combinations of content and viewport size
#14588c88642 Thanks @delucis! - Silences i18n content collection warnings for projects without custom translations.
#1437655aed4 Thanks @hippotastic! - Adds Starlight-specific types to defineEcConfig function and exports StarlightExpressiveCodeOptions.
This provides Starlight types and IntelliSense support for your Expressive Code configuration options inside an ec.config.mjs file. See the Expressive Code documentation for more information.
#1420275f87f Thanks @abdelhalimjean! - Fix rare font-family issue if users have a font installed with a name of ""
#1365a0af7cc Thanks @kevinzunigacuellar! - Correctly format Pagefind search result links when trailingSlash: 'never' is used
#1383490c6ef Thanks @delucis! - Refactors Starlight’s internal virtual module system for components to avoid circular references
This is a change to an internal API.
If you were importing the internal virtual:starlight/components module, this no longer exists.
Update your imports to use the individual virtual modules now available for each component, for example virtual:starlight/components/EditLink.
#1151134292d Thanks @kevinzunigacuellar! - Fixes sidebar auto-generation issue when a file and a directory, located at the same level, have identical names.
For example, src/content/docs/guides.md and src/content/docs/guides/example.md will now both be included and src/content/docs/guides.md is treated in the same way a src/content/docs/guides/index.md file would be.
#13860163634 Thanks @delucis! - Tightens line-height on <LinkCard> titles to fix regression from original design
If you want to preserve the previous line-height, you can add the following custom CSS to your site:
Astro v4’s prefetch support is now enabled by default. If prefetch is not set in astro.config.mjs, Starlight will use prefetch: { prefetchAll: true, defaultStrategy: 'hover' } by default.
If you want to preserve previous behaviour, disable link prefetching in astro.config.mjs:
#1023a3b80f7 Thanks @kevinzunigacuellar! - Respect the trailingSlash and build.format Astro options when creating Starlight navigation links.
⚠️ Potentially breaking change:
This change will cause small changes in link formatting for most sites.
These are unlikely to break anything, but if you care about link formatting, you may want to change some Astro settings.
If you want to preserve Starlight’s previous behavior, set trailingSlash: 'always' in your astro.config.mjs:
⚠️ Potentially breaking change:
This addition changes how Markdown code blocks are rendered. By default, Starlight will now use Expressive Code.
If you were already customizing how code blocks are rendered and don’t want to use the features provided by Expressive Code, you can preserve the previous behavior by setting the new config option expressiveCode to false.
If you had previously added Expressive Code manually to your Starlight project, you can now remove the manual set-up in astro.config.mjs:
Move your configuration to Starlight’s new expressiveCode option.
Remove the astro-expressive-code integration.
For example:
import starlight from '@astrojs/starlight';
import { defineConfig } from 'astro/config';
import expressiveCode from 'astro-expressive-code';
export default defineConfig({
integrations: [
expressiveCode({
themes: ['rose-pine'],
}),
starlight({
title: 'My docs',
expressiveCode: {
themes: ['rose-pine'],
},
}),
],
});
Note that the built-in Starlight version of Expressive Code sets some opinionated defaults that are different from the astro-expressive-code defaults. You may need to set some styleOverrides if you wish to keep styles exactly the same.
#28072cca2d Thanks @cbontems! - Support light & dark variants of the hero image.
⚠️ Potentially breaking change: The hero.image schema is now slightly stricter than previously.
The hero.image.html property can no longer be used alongside the hero.image.alt or hero.image.file properties.
Previously, html was ignored when used with file and alt was ignored when used with html.
Now, those combinations will throw errors.
If you encounter errors, remove the image.hero property that is not in use.
#774903a579 Thanks @HiDeoo! - Support adding HTML attributes to sidebar links from config and frontmatter
#796372ec96 Thanks @HiDeoo! - Add the @astrojs/sitemap and @astrojs/mdx integrations only if they are not detected in the Astro configuration.
⚠️ BREAKING CHANGE The minimum supported version of Astro is now v3.2.0. Make sure you update Astro at the same time as updating Starlight:
Terminal window
npminstallastro@latest
#447b45719b Thanks @andremralves! - Add titleDelimiter configuration option and include site title in page <title> tags
⚠️ BREAKING CHANGE — Previously, every page’s <title> only included its individual frontmatter title.
Now, <title> tags include the page title, a delimiter character (| by default), and the site title.
For example, in the Startlight docs, <title>Configuration Reference</title> is now <title>Configuration Reference | Starlight</title>.
If you have a page where you need to override this new behaviour, set a custom title using the head frontmatter property:
---
title: My Page
head:
- tag: title
content: Custom Title
---
#709140e729 Thanks @delucis! - Add support for overriding Starlight’s built-in components
⚠️ BREAKING CHANGE — The page footer is now included on pages with template: splash in their frontmatter. Previously, this was not the case. If you are using template: splash and want to continue to hide footer elements, disable them in your frontmatter:
---
title: Landing page
template: splash
# Disable unwanted footer elements as needed
editUrl: false
lastUpdated: false
prev: false
next: false
---
⚠️ BREAKING CHANGE — This change involved refactoring the structure of some of Starlight’s built-in components slightly. If you were previously overriding these using other techniques, you may need to adjust your code.
#529c2d0e7f Thanks @delucis! - For improved compatibility with Tailwind, some Starlight built-in class names are now prefixed with "sl-".
While not likely, if you were relying on one of these internal class names in your own components or custom CSS, you will need to update to use the prefixed version.
#488da35556 Thanks @mayank99! - Improved accessibility of LinkCard by only including the title as part of the link text, and using a pseudo-element to keep the card clickable.
#48935cd82e Thanks @HiDeoo! - Respect hidden sidebar frontmatter property when no sidebar configuration is provided
#4410119a49 Thanks @lorenzolewis! - Add support for hiding entries from an autogenerated sidebar:
---
title: About this project
sidebar:
hidden: true
---
#470d076aec Thanks @delucis! - Drop support for the --sl-hue-accent CSS custom property.
⚠️ BREAKING CHANGE — In previous Starlight versions you could control the accent color by setting the --sl-hue-accent custom property. This could result in inaccessible color contrast and unpredictable results.
You must now set accent colors directly. If you relied on setting --sl-hue-accent, migrate by setting light and dark mode colors in your custom CSS:
#47506a205e Thanks @Yan-Thomas! - Locales whose language tag includes a regional subtag now use built-in UI translations for their base language. For example, a locale with a language of pt-BR will use our pt UI translations.
#41938ff53c Thanks @lorenzolewis! - Improve styling of sidebar entries that wrap onto multiple lines
#418c7b2a4e Thanks @delucis! - Set tab-size: 2 on content code blocks to override default browser value of 8
#39931b8a5a Thanks @HiDeoo! - Add new global favicon option defaulting to '/favicon.svg' to set the path of the default favicon for your website. Additional icons can be specified using the head option.
#30369b7d4c Thanks @HiDeoo! - Add new global pagination option defaulting to true to define whether or not the previous and next page links are shown in the footer. A page can override this setting or the link text and/or URL using the new prev and next frontmatter fields.
🐞 Patch Changes
#3185db3e6e Thanks @delucis! - Support relative paths in Starlight config for customCSS and logo paths
#256048e948 Thanks @HiDeoo! - Add new global lastUpdated option defaulting to false to define whether or not the last updated date is shown in the footer. A page can override this setting or the generated date using the new lastUpdated frontmatter field.
⚠️ Breaking change. Starlight will no longer show this date by default. To keep the previous behavior, you must explicitly set lastUpdated to true in your configuration.
starlight({
lastUpdated: true,
}),
🐞 Patch Changes
#264ed1e46b Thanks @astridx! - Add new icon for displaying codeberg.org in social links.
#2374279d75 Thanks @HiDeoo! - Use path instead of slugified path for auto-generated sidebar item configuration
⚠️ Potentially breaking change. If your docs directory names don’t match their URLs, for example they contain whitespace like docs/my docs/, and you were referencing these in an autogenerate sidebar group as my-docs, update your config to reference these with the directory name instead of the slugified version:
#217490fd98 Thanks @delucis! - Updated sidebar styles. Sidebars now support top-level links and groups are styled with a subtle border and indentation to improve comprehension of nesting.
#178d046c55 Thanks @delucis! - Add support for translating the Pagefind search modal
#210cb5b121 Thanks @delucis! - Change page title ID to _top for cleaner hash URLs
⚠️ Potentially breaking change if you were linking manually to #starlight__overview anywhere. If you were, update these links to use #_top instead.
🐞 Patch Changes
#20809fc565 Thanks @delucis! - Update @astrojs/mdx and @astrojs/sitemap to latest
#78d3ee6fc Thanks @delucis! - Add support for customising and translating Starlight’s UI.
Users can provide translations in JSON files in src/content/i18n/ which is a data collection. For example, a src/content/i18n/de.json might translate the search UI:
{
"search.label": "Suchen",
"search.shortcutLabel": "(Drücke / zum Suchen)"
}
This change also allows Starlight to provide built-in support for more languages than just English and adds German & Spanish support.