at.ncvp.me

First Astro project with 'pages' and 'posts' collections

Move images

from src/assets/... to /public

Posted on 29th May 2026 at 08:18 by Admin


Why?

After days struggling on astro-local to get elegant way to include images in MD pages and posts, I decided to move all images to /public from /src/assets/images.

Astro recommends that images are put in /src/assets/images. See Astro documentation

Process

  1. Copy all images from /src/assets/images and /public/assets/images to /public. Copy aopti from astro-blog/public. Convert all images to .webp. Leave images in other locations until all pages have been converted, when they can be deleted.

  2. Move old_cape_code.mp3 to /public

  3. Make sure no posts include images. While image processing methods are still in a state of flux this is a recipe for chaos.
    Actually three posts had images and one had audio. They were easily converted. Quite a few posts not longer made sense, like Where to put stuff? but this is part of a different exercise.

  4. Add aopti script to /public. This converts all images to .webp, which I think is what Astro does to images in /src/assets.

Category: news Tags: edit admin

Rendered by src/pages/posts/[slug].astro