feat: add option to open navbar links in new tab
This commit is contained in:
parent
d8bf0e69a0
commit
3401ad19a4
2 changed files with 4 additions and 4 deletions
|
@ -5,5 +5,5 @@ const navBarItems = siteConfig.navBarItems
|
|||
<nav class="nav">
|
||||
<a href="/" class="home">~</a>
|
||||
<a href="/blog">Blog</a>
|
||||
{navBarItems.map((item) => <a href={item.link}>{item.text}</a>)}
|
||||
{navBarItems.map((item) => <a href={item.link} target={item.openInNewTab !== false ? "_blank" : undefined}>{item.text}</a>)}
|
||||
</nav>
|
|
@ -20,9 +20,9 @@ export const siteConfig = {
|
|||
navBarItems: [
|
||||
// additional items in the navbar
|
||||
// the order of the items will be the same as the order in the array
|
||||
// format is { text: string, link: string }
|
||||
{ text: "RSS", link: "/rss.xml" },
|
||||
{ text: "GitHub", link: "https://github.com/GrassBlock1/mercury" },
|
||||
// format is { text: string, link: string, openInNewTab?: boolean (default: true) }
|
||||
{ text: "RSS", link: "/rss.xml", openInNewTab: true },
|
||||
{ text: "GitHub", link: "https://github.com/GrassBlock1/mercury", openInNewTab: false },
|
||||
],
|
||||
// search
|
||||
// This only works when noClientJavaScript is enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue