Astro 5 brings exciting new features for building modern static sites. In this post, we’ll explore the Content Layer API, improved image optimization, and more.

The Content Layer API

The new Content Layer API provides a powerful way to fetch and manage content from any source. Whether your content lives in Markdown files, a CMS, or a database, the Content Layer makes it easy to query and display.

Improved Image Optimization

Astro 5 introduces enhanced image optimization with automatic responsive image generation. This means your images will look great on any device without any extra configuration.

import { Image } from 'astro:assets';
import myImage from '../assets/photo.jpg';

<Image src={myImage} alt="A beautiful photo" />

Getting Started

To get started with Astro 5, simply run:

npm create astro@latest

This will scaffold a new project with all the latest features enabled by default.