The Cloudfront link would be a tell-tale sign that asset optimisation is enabled for certain file formats. This could be configured in the UI or even possibly with the SSG?
For my site, the asset optimization is off for images:
URLs No URL processing
CSS Minify
JS Minify
Images No image processing
The two methods to link static images are used in the same page. I am not sure why they create a different result. I don’t think Pelican SSG have special methods to trigger the asset optimization.
Just found out that by using plain HTML for <img src="/images/avatar-96x96.png" />
has the same result as ‘method 2’ in my first post.
Edit: it’s using RST with raw html, like:
… raw:: html
See: reStructuredText Directives
So, I think image coded as above or using method 2 are linked to external domain (Amazon) by default? I didn’t know about it because the images had been linking to my domain when I use Netlify for a few months.
When you have any optimizations on, we may optimize files you wouldn’t expect onto cloudfront. The only way to really prevent that is to disable all asset optimization with the checkbox at the top of the asset optimization config widget.
I have a bug report open on this since I don’t think it is intuitive, so we may change it someday, but it won’t be someday very soon based on our current roadmap, so just wanted to help you understand your options for today.