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(v2): remove invalid label attribute of footer links #1980

Merged
merged 3 commits into from
Nov 13, 2019

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Nov 13, 2019

Motivation

A continuation of #1974. This is relevant only for external links.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Before:

<a class="footer__link-item" label="Stack Overflow" href="https://stackoverflow.com/questions/tagged/docusaurus" target="_blank" rel="noopener noreferrer">Stack Overflow</a>

After (without label):

<a class="footer__link-item" target="_blank" rel="noopener noreferrer" href="https://stackoverflow.com/questions/tagged/docusaurus">Stack Overflow</a>

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Nov 13, 2019
@lex111 lex111 changed the title fix(v2): remove invalid attributes of footer links fix(v2): remove invalid label attribute of footer links Nov 13, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Nov 13, 2019

Deploy preview for docusaurus-2 ready!

Built with commit eda2bc7

https://deploy-preview-1980--docusaurus-2.netlify.com

@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Nov 13, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Nov 13, 2019

Deploy preview for docusaurus-preview ready!

Built with commit eda2bc7

https://deploy-preview-1980--docusaurus-preview.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intentional that I passed every prop through as attributes so users can add in more attributes that we don't support. That could have been a bad idea. Thoughts?

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike #1974 this doesn't pass the rest of the props

@lex111
Copy link
Contributor Author

lex111 commented Nov 13, 2019

But footer links cannot have additional attributes, unnecessarily add the rest of the props. https://v2.docusaurus.io/docs/docusaurus.config.js/#themeconfig
Only label and to.

@endiliey
Copy link
Contributor

I'm thinking that maybe we should pass it so that it allow overriding even the target attribute ?

Like

 {
              label: 'Introduction',
              to: 'docs/introduction',
              target: '_blank'
            },

is possible

@lex111
Copy link
Contributor Author

lex111 commented Nov 13, 2019

@endiliey done ✔️, yeah, now I see, all the more reason we need to keep consistency with navlinks.

}
: {
to: toUrl,
})}>
{item.label}
{label}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now i wonder if we should put it right before label instead ? Otherwise the props cannot override rel and target for href

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, exactly, you are absolutely right, fixed!

@lex111
Copy link
Contributor Author

lex111 commented Nov 13, 2019

Strange, Netlify fails, how to restart it?

@endiliey
Copy link
Contributor

Strange, Netlify fails, how to restart it?

One way to restart is to push another commit 😢

@endiliey endiliey merged commit 9cbb703 into facebook:master Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants