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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

"navbar.logo.alt" is not allowed to be empty #3350

Closed
Vinnl opened this issue Aug 27, 2020 · 5 comments 路 Fixed by #3352
Closed

"navbar.logo.alt" is not allowed to be empty #3350

Vinnl opened this issue Aug 27, 2020 · 5 comments 路 Fixed by #3352
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@Vinnl
Copy link
Contributor

Vinnl commented Aug 27, 2020

馃悰 Bug Report

When I use an empty string for navbar.logo.alt in my config, I get the following validation error:

"navbar.logo.alt" is not allowed to be empty

However, since the logo in my navbar is redundant with the actual project name next to it, I don't want screen readers to read out anything for the logo - it would just duplicate the project name.

Have you read the Contributing Guidelines on issues?

I did now.

To Reproduce

(Write your steps here:)

  1. Create a new Docusarus v2 project.
  2. Set navbar.logo.alt in themeConfig in docusaurus.config.js to ''.
  3. Run npm start.

Expected behavior

The website to start just fine.

Actual Behavior

You get the following output:

A validation error occured.
The validation system was added recently to Docusaurus as an attempt to avoid user configuration errors.
We may have made some mistakes.
If you think your configuration is valid and should keep working, please open a bug report.

ValidationError: "navbar.logo.alt" is not allowed to be empty

Your Environment

  • Docusaurus version used: Alpha 61 of v2
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node v12.18.2
  • Operating system and version (desktop or mobile): Ubuntu 20.04

Reproducible Demo

Just the default generated template, with the alt changed.

@Vinnl Vinnl added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Aug 27, 2020
@slorber
Copy link
Collaborator

slorber commented Aug 28, 2020

Hi,

image

In my opinion it is better that the screen reader reads your alt text vs the image filename

@Vinnl
Copy link
Contributor Author

Vinnl commented Aug 28, 2020

@slorber That is about leaving out the alt attribute altogether :) I want to specify an empty alt tag, i.e. <img src="logo.svg" alt=""/>.

See also https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#Attributes

image

@slorber
Copy link
Collaborator

slorber commented Aug 28, 2020

I see.

Do you have a link from an authority that claims alt="" is a recommended practice in some cases?

@Vinnl
Copy link
Contributor Author

Vinnl commented Aug 28, 2020

@slorber Just added it to my previous comment! :)

@slorber
Copy link
Collaborator

slorber commented Aug 28, 2020

thanks, will accept a PR (just need .allow('') in theme validation) or will make one soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants