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

feat(v2): allow specifying custom target for logo link #2344

Merged
merged 2 commits into from
Feb 29, 2020

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Feb 29, 2020

Motivation

Resolve #2339.

This is really useful if users are hosting a website with documentation in a subdirectory of the main site (baseUrl has been changed) and therefore the '/' link will lead to a 404 error (read comments of the issue).

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  1. Set the external link for the navbar.logo.href property, and set the navbar.logo.target property to "_self" - make sure that the external link opens in the current tab (thus, we override the default value when the external link opens in a new tab). This use case is the main goal of PR.

  2. In contrast to the first item, set the navbar.logo.href property to some internal link, and put "_blank" in the navbar.logo.target property, now the internal link should open in a new tab.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@lex111 lex111 added the pr: new feature This PR adds a new API or behavior. label Feb 29, 2020
@lex111 lex111 requested a review from yangshun February 29, 2020 10:54
@lex111 lex111 requested a review from wgao19 as a code owner February 29, 2020 10:54
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 29, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Feb 29, 2020

Deploy preview for docusaurus-2 ready!

Built with commit e6768af

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

@yangshun yangshun changed the title feat(v2): allow specify custom target for logo link feat(v2): allow specifying custom target for logo link Feb 29, 2020
@yangshun yangshun merged commit c171609 into master Feb 29, 2020
@yangshun yangshun deleted the lex111/feat-target-logo branch February 29, 2020 11:28
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: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v2] links: nav & footer links (href) without target="_blank"
4 participants