feat: add image-caption feature
This PR provides a feature to add captions to images. Only CommonMark syntax is supported, so there is no learning cost.
Demo and details are here.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| fuwari-yags | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 5, 2025 3:20pm |
My PC's OS is Windows, so the EOL of the file is CRLF by default. Multiple images doesn't work in the following case.


@ikamusume7 Thanks for reporting! I've fixed it.
lovely update !! thank you for your work 🙏
one thing to note is this breaks images using relative sources, i.e. 
@autumnesponda
When referencing local files in a Markdown file, they must be placed under the public/ directory. For example, a file located at public/images/img.png should be referenced like this.

This restriction also applies to standard image syntax, not just this plugin.
When referencing local files in a Markdown file, they must be placed under the
public/directory. For example, a file located atpublic/images/img.pngshould be referenced like this.This restriction also applies to standard image syntax, not just this plugin.
Just wanted to make note of potentially breaking changes in case this ends up getting merged to master. I have moved my photos to the public directory since I pulled in these changes to my site and think it's worthwhile but on master relative images get resolved fine. see https://docs.astro.build/en/guides/images/#images-in-markdown-files
not suggesting you need to change anything! just wanted to note it
@autumnesponda
I initially misunderstood, but I now fully understand the situation. To prevent breaking changes, I will first apply a temporary workaround and then explore a fundamental solution.
Seems that it doesn't worked with local image? content:

,girl,_Blue,yellow,green,cyan,purple,red,pink,_best,8k,UHD,masterpiece,male%20focus,%201boy,gloves,%20ponytail,%20long%20hair,.jpeg "Directory Structure")
Result:
Astro applies complex processing when optimizing images in the src folder. Currently, the plugin lacks sufficient information to control this behavior effectively. To prevent unintended breaking changes, images in the src folder are explicitly excluded from processing. However, images in the public folder work without any issues.
Relative paths under src/ are now supported.
thats really nice.. great demo as well