Skip to content

Releases: withastro/starlight

@astrojs/[email protected]

03 Mar 23:30
929b778
Compare
Choose a tag to compare

Minor Changes

  • #2931 10b93b3 Thanks @HiDeoo! - Adds support for the title, frame, and meta fence attributes to code blocks.

    These new optional attributes add support for Expressive Code text & line markers. The following example renders a code block using a terminal frame with a title:

    ```js {% title="editor.exe" frame="terminal" %}
    console.log('Hello, world!');
    ```

    Any other text or line markers should be specified using the meta fence attribute. For example, the following code block renders a code block using the diff syntax combined with the js language syntax highlighting and the markers text highlighted:

    ```diff {% meta="lang=js 'markers'" %}
      function thisIsJavaScript() {
        // This entire block gets highlighted as JavaScript,
        // and we can still add diff markers to it!
    -   console.log('Old code to be removed')
    +   console.log('New and shiny code!')
      }
    ```

    To learn more about all the available options, check out the Expressive Code documentation.

@astrojs/[email protected]

27 Feb 18:26
9a5450d
Compare
Choose a tag to compare

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.

@astrojs/[email protected]

19 Feb 23:55
5a7e831
Compare
Choose a tag to compare

Patch Changes

@astrojs/[email protected]

15 Feb 10:46
9b32c6a
Compare
Choose a tag to compare

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

@astrojs/[email protected]

15 Feb 10:46
9b32c6a
Compare
Choose a tag to compare

Minor Changes

  • #2578 f895f75 and #2390 f493361 Thanks @HiDeoo and @delucis!
    ⚠️ BREAKING CHANGE: The minimum supported version of Starlight is now 0.32.0

    Please use the @astrojs/upgrade command to upgrade your project:

    npx @astrojs/upgrade

@astrojs/[email protected]

28 Jan 13:50
095c7bb
Compare
Choose a tag to compare

Minor Changes

  • #2822 e56586a Thanks @KianNH! - Adds a new clientOptionsModule plugin option to support configuring unserializable DocSearch options such as resultsFooterComponent().

    See “DocSearch configuration” in the Starlight docs for more details.

@astrojs/[email protected]

17 Jan 16:26
eb2175d
Compare
Choose a tag to compare

Patch Changes

@astrojs/[email protected]

13 Jan 11:44
437086d
Compare
Choose a tag to compare

Minor Changes

  • #2777 88f4214 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.

    See the Expressive Code release notes for full details.

  • #2736 29a885b Thanks @delucis! - ⚠️ BREAKING CHANGE: The minimum supported version of Astro is now 5.1.5

    Please update Astro and Starlight together:

    npx @astrojs/upgrade
  • #2728 e187383 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.

  • #157 23bf960 Thanks @tony-sull! - Adds a print stylesheet to improve the appearance of Starlight docs pages when printed

  • #2728 e187383 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

  • #2792 412effb 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.

  • #2736 29a885b Thanks @delucis! - Updates internal dependencies @astrojs/sitemap and @astrojs/mdx to the latest versions

  • #2782 d9d415b Thanks @delucis! - Fixes a documentation link in the JSDoc comment for the StarlightExpressiveCodeOptions type

  • #2708 442c819 Thanks @delucis! - Fixes colour contrast correction in code blocks

@astrojs/[email protected]

10 Jan 21:09
f6c4a0c
Compare
Choose a tag to compare

Patch Changes

  • #2722 0b206d3 Thanks @techfg! - Fixes display of long site title on mobile

  • #2762 7ab1576 Thanks @HiDeoo! - Prevents the header title from being translated by automatic translation systems.

@astrojs/[email protected]

07 Jan 15:44
8de6f15
Compare
Choose a tag to compare

Patch Changes

  • #2757 e7b0e74 Thanks @HiDeoo! - Fixes a UI string translation issue for languages with a region subtag.

  • #2760 aec9edd Thanks @HiDeoo! - Adds 5 new icons: left-caret, up-arrow, down-arrow, download, and cloud-download.