rbuchberger / jekyll_picture_tag

Easy responsive images for Jekyll.
https://rbuchberger.github.io/jekyll_picture_tag/
BSD 3-Clause "New" or "Revised" License
620 stars 106 forks source link

Feature: --link with title attribute for accessability #264

Open inetbiz opened 3 years ago

inetbiz commented 3 years ago

read https://www.deque.com/blog/text-links-practices-screen-readers/ a href's should at LEAST contain a title="" attribute for screen readers.

Your documentation is here https://rbuchberger.github.io/jekyll_picture_tag/users/liquid_tag/argument_reference/link.html

Proposed

{% picture [preset] [image] --alt {{post.title}} --link {{post.url}} "[whatever one wants to put about the link]" %}
// -- link [URL] "[title]"
rbuchberger commented 3 years ago

You can accomplish this with --a title="my title", though it's a bit cumbersome.

What if we just took the --alt argument and made it the title? Or make a --title flag which works the same way? Or some combination of both; use --title if present, otherwise use alt.

inetbiz commented 3 years ago

You can accomplish this with --a title="my title", though it's a bit cumbersome.

What if we just took the --alt argument and made it the title? Or make a --title flag which works the same way? Or some combination of both; use --title if present, otherwise use alt.

@rbuchberger The alt describes the photo. I'll try the --a title="~"

inetbiz commented 3 years ago

You can accomplish this with --a title="my title", though it's a bit cumbersome.

Update https://rbuchberger.github.io/jekyll_picture_tag/users/liquid_tag/argument_reference/link.html or somewhere else? with title attribute on link?

rbuchberger commented 3 years ago

The --a flag allows you to add arbitrary HTML attributes to the anchor tag.

I think --title is the way to go; it's the simplest to parse and it's in line with the existing API. I'll mark it as a feature request, might be a good first issue if anyone wants to contribute. You can look at how the --alt flag works as a guide.

We just had a kid and I'm working full time, so I'm real busy these days. If nobody else writes it I'll get to it eventually, but I can't promise a timeline.

inetbiz commented 3 years ago

@rbuchberger worked well. I just suggest the documentation at https://rbuchberger.github.io/jekyll_picture_tag/users/liquid_tag/argument_reference/link.html should mention that.