Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit 7b40060

Browse files
committed
fix blog link open issue
1 parent ddd04f9 commit 7b40060

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

components/header.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default props => {
4848
{
4949
title: 'Blog',
5050
path: 'https://coderplex.org/blog',
51-
external: false,
51+
external: true,
5252
},
5353
];
5454
return (
@@ -65,16 +65,27 @@ export default props => {
6565
{navItems.map(item => {
6666
return (
6767
<li key={item.title} className="nav__linkItem">
68-
<Link href={item.path}>
68+
{item.external ? (
6969
<a
70+
href={item.path}
7071
className={`nav__link ${props.url.pathname === item.path
7172
? 'nav__link--active'
7273
: ''}`}
73-
target={item.external ? '_blank' : '_self'}
7474
>
7575
{item.title}
7676
</a>
77-
</Link>
77+
) : (
78+
<Link href={item.path}>
79+
<a
80+
className={`nav__link ${props.url.pathname ===
81+
item.path
82+
? 'nav__link--active'
83+
: ''}`}
84+
>
85+
{item.title}
86+
</a>
87+
</Link>
88+
)}
7889
</li>
7990
);
8091
})}

0 commit comments

Comments
 (0)