File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const config: GatsbyConfig = {
15
15
{
16
16
resolve : `gatsby-source-filesystem` ,
17
17
options : {
18
- path : `${ __dirname } /content/blog ` ,
18
+ path : `${ __dirname } /content` ,
19
19
name : `blog` ,
20
20
} ,
21
21
} ,
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ interface NavbarProps {
9
9
10
10
const items = [ {
11
11
name : "Home" ,
12
- link : "/"
12
+ link : "/" ,
13
+ exact : true
13
14
} , {
14
15
name : "Experience" ,
15
16
link : "#experience"
@@ -28,7 +29,7 @@ const Navbar = ({ location }: NavbarProps) => {
28
29
{ items . map ( item => (
29
30
< li key = { item . name } >
30
31
< Link to = { item . link } className = { classNames ( {
31
- [ styles . active ] : item . link . startsWith ( "/" ) && location . pathname === item . link
32
+ [ styles . active ] : item . link . startsWith ( "/" ) && ( item . exact ? location . pathname === item . link : location . pathname . startsWith ( item . link ) )
32
33
} ) } > { item . name } </ Link >
33
34
</ li >
34
35
) ) }
You can’t perform that action at this time.
0 commit comments