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

Make logo alt text configurable #3503

Closed
4 tasks done
bmustill-rose opened this issue Jan 27, 2022 · 1 comment
Closed
4 tasks done

Make logo alt text configurable #3503

bmustill-rose opened this issue Jan 27, 2022 · 1 comment
Labels
resolved by config change Issue can be mitigated by the reporter

Comments

@bmustill-rose
Copy link
Sponsor

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

Hi,

It would be useful if it were possible to configure alt text for the logo through the configuration file. I'm currently doing it manually by modifying the generated HTML files but have only been playing with the theme for a few days so may have missed something - apologies if so.

As a side note, anecdotally, aria-label is typically spoken in preference to the value of alt, so to make this work the aria-label for the anchor either needs to be set to the desired alt text or removed completely which is the approach I'd recommend FWIW.

Thanks.

Use Cases

  • Being able to specify alt text in the configuration file instead of having to add it manually would save time
  • Making it more of a feature of the theme may encourage greater adoption
  • Alt text is an important accessibility requirement for non-decorational images

Screenshots / Mockups

No response

@squidfunk
Copy link
Owner

squidfunk commented Jan 27, 2022

Thanks for suggesting. This is actually a very good use case for theme extension, as I don't consider it a good idea to make attributes on elements configurable. It's just too fine grained. When we would make the alt text configurable, the next user would want to add a title, or a separate second logo which is only shown on mobile, etc. I think you get the gist.

The logo is hosted in its own partial, so overriding it is absolutely trivial 😊

<!-- Logo -->
{% if config.theme.logo %}
<img src="{{ config.theme.logo | url }}" alt="logo" />
{% else %}
{% set icon = config.theme.icon.logo or "material/library" %}
{% include ".icons/" ~ icon ~ ".svg" %}
{% endif %}

Additionally:

  • Being able to specify alt text in the configuration file instead of having to add it manually would save time

You only pay the investment once when you override the partial.

  • Making it more of a feature of the theme may encourage greater adoption

I doubt that an alt tag would aid in adoption

  • Alt text is an important accessibility requirement for non-decorational images

The logo has an alt tag, defaulting to "logo".

@squidfunk squidfunk added the resolved by config change Issue can be mitigated by the reporter label Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolved by config change Issue can be mitigated by the reporter
Projects
None yet
Development

No branches or pull requests

2 participants