惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
D
Docker
K
Kaspersky official blog
Latest news
Latest news
P
Privacy International News Feed
雷峰网
雷峰网
S
Security Affairs
博客园 - 司徒正美
博客园 - Franky
C
CERT Recently Published Vulnerability Notes
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
C
Check Point Blog
T
Tailwind CSS Blog
T
Tenable Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
L
Lohrmann on Cybersecurity
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
B
Blog
The Hacker News
The Hacker News
V
V2EX
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
W
WeLiveSecurity
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
S
Securelist
V2EX - 技术
V2EX - 技术
博客园 - 叶小钗
The Cloudflare Blog
小众软件
小众软件
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Register - Security
The Register - Security

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Astro 5.16 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13 What's new in Astro - July 2025 Astro 5.12 Starlight 0.35 Astro 5.11 What's new in Astro - June 2025 Live Content Collections: A Deep Dive Introducing… Astro Mart Astro Solstice Festival Astro 5.10 Astro 5.9 What's new in Astro - May 2025 Astro 5.8 What's new in Astro - April 2025 2025 Technical Steering Committee Starlight April Update Astro 5.7 Astro Agency Partner Program Astro 5.6 What's new in Astro - March 2025 Astro 5.5 What's new in Astro - February 2025 Astro 5.4 Astro 5.3 What's new in Astro - January 2025 Astro 5.2 2024 year in review What's new in Astro - December 2024 Astro 5.1 Astro 5.0 Google IDX: Our Official Online Editor Partner What's new in Astro - November 2024 What's new in Astro - October 2024 Astro x Cloudinary SDK What's new in Astro - September 2024 Community Loaders for Astro Content Layer Astro x Hygraph: Content Loader Astro x Cloudinary: Content Loader Astro x Storyblok: Content Loader Content Layer: A Deep Dive Starlight 0.28 Astro 5.0 Beta Release The $100,000 Astro Ecosystem Fund Fall Update Goodbye Studio, Hello DB What's new in Astro - August 2024 Astro 4.15 Astro 4.14 Astro 4.13 What's new in Astro - July 2024 Astro 4.12: Server Islands Netlify: Our Official Deployment Partner What's new in Astro - June 2024 Astro 4.11 Astro Together 2024 Server Islands The Astro Content Layer Zero-JavaScript View Transitions Astro 4.10 Starlight turns one year old! What's new in Astro - May 2024 Astro 4.9 Astro 4.8 What's new in Astro - April 2024 Astro 4.7 Astro 4.6 What's new in Astro - March 2024 Migrating 500+ tests from Mocha to Node.js Astro DB: A Deep Dive The Astro Developer Portal Astro DB Astro 4.5
Starlight 0.32
Chris Swithinbank · 2025-02-17 · via The Astro Blog

Starlight 0.32 is here! Let’s unpack what’s new as we work our way towards a v1 release.

🧘 We’ve been stretching to make Starlight extra extendable. Here’s our latest flow for more flexibility:

  • Route data middleware
  • New i18n APIs for plugins
  • Updated plugin hooks
  • Multisite search support

To upgrade an existing Starlight site, use the automated @astrojs/upgrade CLI tool. This will update Starlight, Astro, and any other integrations you are using:

A new route data paradigm

Starlight’s component override system allows users to customize a site’s appearance with their own components. This is great for extending Starlight’s UI, but over time, we saw a pattern develop where people also used overrides to modify component data, while still reusing Starlight’s built-in components.

To make this use case easier, v0.32 introduces a new route middleware system that provides full access to Starlight’s data model without needing to override any components. This is particularly helpful for plugins as it avoids common conflicts where several plugins tried to override the same component.

Similar to Astro’s middleware system, route middleware is called for every Starlight page render and gives you the opportunity to modify any data before it gets rendered. This is a powerful way to implement custom logic not currently possible with configuration alone.

In the following example, we try to make our docs more exciting by adding exclamation marks to the end of every page’s title!!!

import { defineRouteMiddleware } from '@astrojs/starlight/route-data';

export const onRequest = defineRouteMiddleware((context) => {

// Get the content collection entry for this page.

const { entry } = context.locals.starlightRoute;

// Update the title to add exclamation marks.

entry.data.title = entry.data.title + '!!!';

});

See the “Route Data” guide for full details about how to write route middleware.

Breaking changes

To better support route middleware, we have updated how Starlight’s default components receive route data.

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.

See the Starlight changelog for full details of how to migrate to this new approach.

New i18n APIs for plugins

This release gives plugins full access to Starlight’s powerful built-in internationalization system.

Plugins can now call useTranslations() in the config:setup hook to access any of Starlight’s UI strings. This opens up possibilities for localized logging, using translations in Markdown plugins, and more.

This example plugin logs Starlight’s default “Built with Starlight” text string and uses the translation matching the user’s locale if it is available:

export default {

name: 'localizedPlugin',

hooks: {

'config:setup'({ useTranslations, logger }) {

// Detect the current user’s preferred locale.

const userLocale = Intl.DateTimeFormat().resolvedOptions().locale;

// Get a `t()` function for the locale.

const t = useTranslations(userLocale);

// Log the localized string.

logger.info(t('builtWithStarlight.label'));

},

},

};

Updated plugin hooks

As part of the rework to support translation use in plugins, we have split the old setup hook into two: i18n:setup and config:setup. Use of the setup hook is deprecated and plugins should migrate to using config:setup instead:

export default {

name: 'starlight-plugin',

hooks: {

'setup'({ config }) {

'config:setup'({ config }) {

// Your plugin configuration setup code

},

},

};

Plugins using the injectTranslations() utility need to move this to the dedicated 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' },

});

},

},

};

Multisite search support

Starlight provides site search out of the box using Pagefind. This release exposes Pagefind’s multisite search configuration, so you can support searching across multiple sites.

For example, if you have a main site at example.com indexed with Pagefind and your Starlight site deployed to the docs.example.com subdomain, you can display search results from your main site in your docs with the mergeIndex configuration option:

import { defineConfig } from 'astro/config';

import starlight from '@astrojs/starlight';

export default defineConfig({

site: 'https://docs.example.com/',

integrations: [

starlight({

title: 'Docs with multisite search',

pagefind: {

mergeIndex: [{ bundlePath: 'https://example.com/pagefind' }],

},

}),

],

});

See Pagefind’s guide to “Searching multiple sites” for full details of the available configuration options.

Bug fixes and more

As always, we’ve also been working to fix issues since the v0.31 release. See the Starlight changelog for all the details including detailed migration guidance.

Thanks

Thanks to everyone who contributed to this release with PRs and reviews, including HiDeoo, Emilien Guilmineau, trueberryless, Sarah Rainsberger, Lorenzo Lewis, and Yan Thomas.

We look forward to seeing what you build with Starlight 0.32! If you have questions, comments, or just want to say hi, drop by the Astro Discord.