Open nfriedly opened 1 month ago
The isRemoteURL()
function was based on the same function from eleventy-img
project. Even if I allow schema relative URLs in this plugin, it will fail down the pipeline, as I'm using eleventy-img
to the processing.
I'll file an issue in the eleventy-img
project, and see their response.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I think this is still an issue
I had one old html file in my site with the following bit:
That url is now dead, but the error that eleventy-plugin-img2picture gave me is:
That
ENOENT: no such file or directory, stat 'src/s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png'
is the wrong error for a remote URL - I believe it's not recognizing the//
at the beginning as a protocol-relative URL and therfore trying to treat it as a local file. (I haveeleventyInputDir: 'src'
in my config.)These are fairly rare these days, but they are still valid. The browser just makes it either http or https, whichever the page is.
Running
new URL('//example.com/image.jpg')
will throw, because it doesn't have enough context to know if it should use http or https. However, these work in a img src attribute, because the browser has that context.