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
-
Copy all images from /src/assets/images and /public/assets/images to /public. Copy
aoptifrom astro-blog/public. Convert all images to .webp. Leave images in other locations until all pages have been converted, when they can be deleted. -
Move
old_cape_code.mp3to /public -
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. -
Add
aoptiscript to /public. This converts all images to .webp, which I think is what Astro does to images in /src/assets.