Images, Covers and the Banner
Chapter uses images in four places: post covers, images inside posts, the home page banner and the social card shown when a link is shared. This post covers each.
Post covers
Set heroImage in the frontmatter to a path under public/:
---title: 'My post'heroImage: '/covers/my-post.webp'---The cover is shown in two sizes:
| Where | Shape | Notes |
|---|---|---|
| Top of the post | 16:9 | Shown at up to 1920 × 1080 |
| Post lists | 16:10 | A small thumbnail beside the title |
Both are cropped to fill their frame, so keep the subject near the centre. A 1920 × 1080 WebP is a good default. Posts without a cover simply have no image; the lists stay aligned either way.
The cover is also the post’s social card (og:image), so it is what people see when the link is shared.
Images inside a post
Use standard Markdown. Put the file under public/ and write the path from the site root:
Images take the width of the text column and get rounded corners. Click one to open it full screen, where you can zoom in with the mouse wheel or a double tap.
Write real alt text. It is read aloud by screen readers and shown when an image fails to load; “screenshot” does not help anyone.
The home page banner
Without images, the banner draws a grid pattern in the theme colours. To use your own, add one image for light mode and one for dark mode in src/config/banner.ts:
export const BANNER_CONFIG = { light: { src: '/banner/light.webp', position: 'center 60%', }, dark: { src: '/banner/dark.webp', position: 'center 40%', credit: { text: 'Artist name', url: 'https://example.com/artwork' }, },};The banner is wide and short (from 2:1 on phones to 4.5:1 on large screens), so most of the image is cropped away. position is a CSS background-position that picks which part stays. Use the same image for both modes if you only have one.
credit adds a small attribution pill in the corner. If you did not make the image, credit the artist and make sure the licence allows you to use it.
The social card
Pages without a cover, like the home page and archive, use public/og-default.png. Replace it with a 1200 × 630 image of your own. The path is set by IMAGES.defaultBlog in src/config/site.ts.
Avatar and favicon
- Avatar: replace
public/avatar.svg, or pointIMAGES.defaultAvatarinsite.tsat another file. A square image of at least 176 × 176 looks sharp everywhere it appears. - Favicon: replace
public/favicon.svg.