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">
|
<nav class="nav">
|
||||||
<a href="/" class="home">~</a>
|
<a href="/" class="home">~</a>
|
||||||
<a href="/blog">Blog</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>
|
</nav>
|
|
@ -20,9 +20,9 @@ export const siteConfig = {
|
||||||
navBarItems: [
|
navBarItems: [
|
||||||
// additional items in the navbar
|
// additional items in the navbar
|
||||||
// the order of the items will be the same as the order in the array
|
// the order of the items will be the same as the order in the array
|
||||||
// format is { text: string, link: string }
|
// format is { text: string, link: string, openInNewTab?: boolean (default: true) }
|
||||||
{ text: "RSS", link: "/rss.xml" },
|
{ text: "RSS", link: "/rss.xml", openInNewTab: true },
|
||||||
{ text: "GitHub", link: "https://github.com/GrassBlock1/mercury" },
|
{ text: "GitHub", link: "https://github.com/GrassBlock1/mercury", openInNewTab: false },
|
||||||
],
|
],
|
||||||
// search
|
// search
|
||||||
// This only works when noClientJavaScript is enabled
|
// This only works when noClientJavaScript is enabled
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue