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

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
IT之家
IT之家
B
Blog
博客园_首页
量子位
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
J
Java Code Geeks
H
Help Net Security
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News

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
Astro 5.12
Matt Kane · 2025-07-17 · via The Astro Blog

⚽ Astro 5.12 knocks it into the back of the net, with an upgraded Netlify dev experience, TOML support in content loaders, and more!

The starting lineup includes:

  • TOML support for content loaders
  • New Netlify dev experience
  • Experimental raw environment values

To upgrade an existing project, use the automated @astrojs/upgrade CLI tool. Alternatively, upgrade manually by running the upgrade command for your package manager:

# Recommended:

npx @astrojs/upgrade

# Manual:

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

TOML support for content loaders

Astro 5.12 brings native support for TOML files in content collections. Astro’s file() and glob() content loaders have had you covered for Markdown, JSON, and YAML files, and now you can use TOML files as well.

There’s no configuration needed to enable TOML support: just add .toml files to a collection using a built-in loader. For example, if you have a directory of TOML files like this:

name = "Apollo"

launch_date = "1969-07-16"

crew = ["Neil Armstrong", "Buzz Aldrin", "Michael Collins"]

You can then create a content collection that includes the TOML files:

import { defineCollection, z } from 'astro:content';

import { glob } from 'astro/loaders';

const spacecraft = defineCollection({

loader: glob({ pattern: '*.toml', base: './src/content/spacecraft' }),

schema: z.object({

name: z.string(),

launch_date: z.coerce().date(),

crew: z.array(z.string()),

}),

});

export const collections = { spacecraft };

You can then access the TOML content in your Astro components:

---

import { getCollection } from 'astro:content';

const spacecraft = await getCollection('spacecraft');

---

<ul>

{

spacecraft.map((item) => (

<li>

<h2>{item.name}</h2>

<p>Launch Date: {item.launch_date.toLocaleDateString()}</p>

<p>Crew: {item.crew.join(', ')}</p>

</li>

))

}

</ul>

New Netlify dev experience

The Netlify adapter is now powered by Netlify’s very own Vite plugin during development, bringing Netlify’s entire platform and primitives to your local dev environment!

The power of Netlify on localhost

Until now, using Netlify primitives with Astro during local development required running your project through the Netlify CLI. The new adapter embeds these capabilities directly into Astro’s dev server instead.

After upgrading to the latest version of the adapter, running astro dev will provide:

Configuring dev features

Along with these features comes a way to configure them. The Netlify adapter now accepts a devFeatures option in its configuration to customize which features are enabled during development. Currently, the features you can configure are:

  • images: Enables the local Netlify Image CDN for Astro images during dev. Defaults to true.
  • environmentVariables: Automatically populates your development server with environment variables from your linked Netlify site. Defaults to false.

You pass this as an option to the Netlify adapter in your Astro configuration file:

import { defineConfig } from 'astro/config'

import netlify from '@astrojs/netlify'

export default defineConfig({

adapter: netlify({

devFeatures: {

environmentVariables: true,

images: false,

},

})

})

Now you can enjoy the rich Netlify flavor in your own home!

Thanks to Eduardo Bouças and chee rabbits from Netlify who contributed this feature. Extra thanks to chee who contributed to this post too.

Experimental raw environment values

A new experimental configuration option allows you to opt out of Astro’s automatic type coercion for environment variable values in import.meta.env. By default, Astro converts string values like "true", "false", "1", and "0" to their respective types, but this can be unexpected since environment variables are generally expected to be strings.

This aligns Astro’s behavior with Vite’s handling of environment variables, and is likely to become the default in a future major release.

To enable this feature, add the rawEnvValues flag to your Astro configuration:

export default defineConfig({

experimental: {

rawEnvValues: true,

},

});

This experimental option only affects the import.meta.env object and doesn’t impact the astro:env module that powers Astro’s type-safe environment variables.

Thanks to Adam Langbert who contributed this feature.

Bug fixes

As always, we’ve been working hard on fixing issues since the 5.11 release. See the changelog for all the details.

The Astro core team is:

Alexander Niebuhr , Ben Holmes , Caleb Jasik , Chris Swithinbank , Emanuele Stoppa , Erika , Florian Lefebvre , Fred Schott , Fuzzy , HiDeoo , Luiz Ferraz , Matt Kane , Matthew Phillips , Nate Moore , Reuben Tier , Sarah Rainsberger , and Yan Thomas

Thanks to all the other contributors who helped make Astro 5.12 possible with code and docs additions and improvements, including:

Adam Langbert, Adam Matthiesen, Adit Sachde, Anmoti, Armand Philippot, chee, coderfee, Dixon Sean Low Yan Feng, Eduardo Bouças, Farhad, Junseong Park, Kenichi Nakamura, knj, liruifengv, Martin Trapp, Matthew Justice, Nin3, Paul Valladares, Philippe Serhal, Reuben Tier, Rezix, Robbie Wagner, ryu, Surya Kencana Putra, Thomas Bonnet, and Toby Nguyen