Skip to content

Example Post With a Cover Image

A demo post showing how cover images work on this blog. This post can be safely deleted.

· 1 min read ·
Cover image for Example Post With a Cover Image

This is an example post demonstrating cover image support. The cover image above is pulled from Unsplash and optimized at build time via Astro’s built-in image pipeline.

How It Works

Add a cover field to your frontmatter pointing to a local image:

---
cover: ../../assets/blog/example-cover.jpg
---

Astro will optimize it automatically — resizing, converting to modern formats, and generating responsive srcset attributes.

Inline Images

You can also use images inline within MDX content. Here’s the same image used inline:

An example inline image