Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect alt for screenshot <img> #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Krinkle
Copy link

@Krinkle Krinkle commented Jan 20, 2025

Problem:

The alt text is set to "Screenshot for v1.screenshot.11ty.dev", followed by a percent-encoded version of the URL, instead of simply "Screenshot for github.com/example/foo".

https://www.zachleat.com/web/eleventy-three-beta/

Example of what it looks like in Firefox while the image is loading and/or if the image fails to load for some network connectivity reason:

capture

Solution:
I've not tested or confirmed this, but this might be coming from _11ty/imagePlugin.js where there seems to be a mixup between the "targetUrl" and "fullUrl" variable names, which carry the opposite meaning than they do elsewhere in the same file. The opengraph version and its alt text was set correctly already.

The alt text was set to "Screenshot for v1.screenshot.11ty.dev"
instead of "Screenshot for github.com/example/foo".

The alt text for the opengraph version of this was set correctly
already, but in this function the name "targetUrl" and "fullUrl"
carried a different meaning than elsewhere in the same file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant