question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Target blank in header link of siteconfig.js

See original GitHub issue

🐛 Bug Report

How to add support for target='_blank' in headerlink of siteconfig.js file

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

Tried to have external link in header segment {href: 'https://github.com', label: 'Github', target: '_blank'}

Expected behavior

It should be redirect the user to that particular site, once they click the link

Actual Behavior

After rendering it is displayed below mentioned screenshot

Your Environment

  • Docusaurus version used: ^1.14.4

  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Version 81.0.4044.129 (Official Build) (64-bit)

  • Operating system and version (desktop or mobile): macOS mojave (Version 10.14.6)

Reproducible Demo

https://gist.github.com/sriramgroot/093b67699a57bdff0308857e9fbfc11e

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yangshuncommented, Jun 5, 2020

Pull requests welcome.

0reactions
slorbercommented, Jun 29, 2020

Hey, this exists in v1 since 2017, just wasn’t documented 🤪

  { href: "https://github.com/", label: "GitHub", external: true },

=> #3011

Read more comments on GitHub >

github_iconTop Results From Across the Web

siteConfig.js - Docusaurus v1
Links that will be used in the header navigation bar. ... Links to href destination, using target=_blank (external) { href: ...
Read more >
Docusaurus - how to open external links in new tab?
Write your own plugin that understands such a [link](url){:target="_blank"} syntax and generates the HTML that you want.
Read more >
https://www.nationalacademies.org/_cache_3c3d/_the...
SCS_PAGE_HEADER--> <link rel="shortcut icon" href="<! ... headerType"> <nas-global-nav ref="globalNav" v-if="siteConfig.headerFooterInfo.
Read more >
Set up navbars and footers - Redocly
For external links, use either external: true or the target: _blank property. Links with external: true automatically get an indicator icon displayed next...
Read more >
URL Management | Hugo
Hugo supports permalinks, aliases, link canonicalization, and multiple options for handling relative vs absolute URLs. Permalinks. The default Hugo target ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found