Skip to content

All versions since 0.31.1

0.31.1

Patch Changes

0.32.0

Minor Changes

  • #2390 f493361 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 { lastUpdated } = Astro.props;
    const { lastUpdated } = Astro.locals.starlightRoute;
    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.

  • #2578 f895f75 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
    },
    },
    };
  • #2578 f895f75 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',
    },
    });
    },
    },
    };
  • #2858 2df9d05 Thanks @XREvo! - Adds support for Pagefind’s multisite search features

  • #2578 f895f75 Thanks @HiDeoo! - Adds a new HookParameters utility type to get the type of a plugin hook’s arguments.

  • #2578 f895f75 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.

  • #2578 f895f75 Thanks @HiDeoo! - Adds a new absolutePathToLang() callback function to the Starlight plugin config:setup to get the language for a given absolute file path.

Patch Changes

0.32.1

Patch Changes

0.32.2

Patch Changes

  • #2926 c0170fd Thanks @resoltico! - Adds Latvian language support

  • #2918 790c000 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.

0.32.3

Patch Changes

0.32.4

Patch Changes

0.32.5

Patch Changes

0.32.6

Patch Changes

0.33.0

Minor Changes

  • #3026 82deb84 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.

  • #3025 f87e9ac Thanks @delucis! - Makes social configuration more flexible.

    ⚠️ 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:

    social: {
    github: 'https://github.com/withastro/starlight',
    discord: 'https://astro.build/chat',
    },
    social: [
    { icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' },
    { icon: 'discord', label: 'Discord', href: 'https://astro.build/chat' },
    ],
  • #2927 c46904c 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.

  • #2924 6a56d1b 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:

    <Badge text="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
  • #2727 7c8fa30 Thanks @techfg! - Updates mobile menu toggle styles to display a close icon while the menu is open

Patch Changes

0.33.1

Patch Changes

  • #3088 1885049 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.

  • #3065 463adf5 Thanks @HiDeoo! - Updates the social configuration option TSDoc example to match the shape of the expected value.

0.33.2

Patch Changes

0.34.0

Minor Changes

  • #2322 f14eb0c Thanks @HiDeoo! - Groups all of Starlight’s CSS declarations into a single starlight cascade layer.

    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.

  • #3122 3a087d8 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:

    head.push({
    tag: 'style',
    content: 'div { color: red }'
    attrs: {},
    });
    head.push({
    tag: 'link',
    content: ''
    attrs: { rel: 'me', href: 'https://example.com' },
    });

    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.

  • #3033 8c19678 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.

    Please update Starlight and Astro together:

    Terminal window
    npx @astrojs/upgrade
  • #2322 f14eb0c Thanks @HiDeoo! - Removes Shiki css-variables theme fallback.

    ⚠️ BREAKING CHANGE:

    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:

    :root {
    --astro-code-foreground: var(--sl-color-white);
    --astro-code-background: var(--sl-color-gray-6);
    --astro-code-token-constant: var(--sl-color-blue-high);
    --astro-code-token-string: var(--sl-color-green-high);
    --astro-code-token-comment: var(--sl-color-gray-2);
    --astro-code-token-keyword: var(--sl-color-purple-high);
    --astro-code-token-parameter: var(--sl-color-red-high);
    --astro-code-token-function: var(--sl-color-red-high);
    --astro-code-token-string-expression: var(--sl-color-green-high);
    --astro-code-token-punctuation: var(--sl-color-gray-2);
    --astro-code-token-link: var(--sl-color-blue-high);
    }

Patch Changes

  • #3118 77a1104 Thanks @delucis! - Fixes passing imported SVGs to the frontmatter prop of the <StarlightPage> component in Astro ≥5.7.0

0.34.1

Patch Changes

  • #3140 f6eb1d5 Thanks @HiDeoo! - Fixes a text selection issue for heading with a clickable anchor link when using double or triple click to select text.

  • #3148 dc8b6d5 Thanks @HiDeoo! - Fixes a regression of the Starlight icon color when using the credits configuration option.

0.34.2

Patch Changes

  • #3153 ea31f46 Thanks @SuperKXT! - Fixes hover styles for highlighted directory in FileTree component.

  • #2905 b5232bc 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.

  • #3165 80a7871 Thanks @KianNH! - Increases maxBuffer for an internal spawnSync() call to support larger Git commit histories when using Starlight’s lastUpdated feature.

  • #3158 d1f3c8b Thanks @heisenberg0924! - Adds Hungarian language support

0.34.3

Patch Changes

0.34.4

Patch Changes

0.34.5

Patch Changes

  • #3282 7680e87 Thanks @alvinometric! - Moves padding of <main> element to a --sl-main-pad CSS custom property to simplify setting custom values

  • #3288 131371e Thanks @HiDeoo! - Fixes a potential configuration issue for multilingual sites with a default language including a regional subtag.

0.34.6

Patch Changes

0.34.7

Patch Changes

0.34.8

Patch Changes

  • #3306 21fcd94 Thanks @HiDeoo! - Fixes a regression in Starlight version 0.34.5 that caused multilingual sites with a default locale explicitly set to root to report a configuration error.

0.35.0

Minor Changes

  • #2261 778b743 Thanks @shubham-padia! - Adds support for using any of Starlight’s built-in icons in asides.

  • #3272 e7fe267 Thanks @delucis! - Adds a new generateId option to Starlight’s docsLoader()

    This enables overriding the default sluggifier used to convert content filenames to URLs.

  • #3276 3917b20 Thanks @delucis! - Excludes banner content from search results

    Previously, content set in banner in page frontmatter was indexed by Starlight’s default search provider Pagefind. This could cause unexpected search results, especially for sites setting a common banner content on multiple pages. Starlight’s default Banner component is now excluded from search indexing.

    This change does not impact Banner overrides using custom components.

  • #3266 1161af0 Thanks @HiDeoo! - Adds support for custom HTML attributes on autogenerated sidebar links using the autogenerate.attrs option.

  • #3274 80ccff7 Thanks @HiDeoo! - Fixes an issue where some Starlight remark and rehype plugins were transforming Markdown and MDX content in non-Starlight pages.

    ⚠️ BREAKING CHANGE:

    Previously, some of Starlight’s remark and rehype plugins, most notably the plugin transforming Starlight’s custom Markdown syntax for rendering asides, were applied to all Markdown and MDX content. This included content from individual Markdown pages and content from content collections other than the docs collection used by Starlight.

    This change restricts the application of Starlight’s remark and rehype plugins to only Markdown and MDX content loaded using Starlight’s docsLoader(). If you were relying on this behavior, please let us know about your use case in the dedicated #starlight channel in the Astro Discord or by opening an issue.

Patch Changes

  • #3266 1161af0 Thanks @HiDeoo! - Ensures invalid sidebar group configurations using the attrs option are properly reported as a type error.

    Previously, invalid sidebar group configurations using the attrs option were not reported as a type error but only surfaced at runtime. This change is only a type-level change and does not affect the runtime behavior of Starlight which does not support the attrs option for sidebar groups.

  • #3274 80ccff7 Thanks @HiDeoo! - Prevents Starlight remark and rehype plugins from transforming Markdown and MDX content when using the Astro renderMarkdown() content loader API.

0.35.1

Patch Changes

0.35.2 Latest

Patch Changes

  • #3341 10f6fe2 Thanks @HiDeoo! - Prevents potential build issues with the Astro Cloudflare adapter due to the dependency on Node.js builtins.

  • #3327 bf58c60 Thanks @delucis! - Fixes a routing bug for docs pages with a slug authored with non-normalized composition. This could occur for filenames containing diacritics in some circumstances, causing 404s.