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

Consider using actual figcaptions #58

Open
oliverjam opened this issue Feb 4, 2022 · 1 comment
Open

Consider using actual figcaptions #58

oliverjam opened this issue Feb 4, 2022 · 1 comment

Comments

@oliverjam
Copy link

return `<li>
<p>${user.userObj.username}</p>
<p>${post.caption}</p>
${
post.img
? `<img id="post-img" src="/post/${post.id}/img" alt="${post.caption}">`
: ""
}
</li>`;

Since you're posting self-contained images with captions, the <figure> and <figcaption> elements might be a good fit for the feed here

@oliverjam
Copy link
Author

Also related to a11y - you don't need to duplicate the visible caption in the alt attribute. The caption is for information about the image, whereas alt is for describing the contents of the image. So e.g. the caption might be "my favourite pet Nick Cage", and the alt would be "legendary actor Nick Cage wearing a sick leather jacket with a confused look on his face". Unfortunately this does mean the alt has to be written by the uploader. In this situation it's probably fine to leave the alt empty.

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

No branches or pull requests

1 participant