Skip to content

Commit 72b90f5

Browse files
committed
fix urls
1 parent ae90e2d commit 72b90f5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gatsby-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const config: GatsbyConfig = {
1515
{
1616
resolve: `gatsby-source-filesystem`,
1717
options: {
18-
path: `${__dirname}/content/blog`,
18+
path: `${__dirname}/content`,
1919
name: `blog`,
2020
},
2121
},

src/components/Navbar/Navbar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ interface NavbarProps {
99

1010
const items = [{
1111
name: "Home",
12-
link: "/"
12+
link: "/",
13+
exact: true
1314
}, {
1415
name: "Experience",
1516
link: "#experience"
@@ -28,7 +29,7 @@ const Navbar = ({ location }: NavbarProps) => {
2829
{items.map(item => (
2930
<li key={item.name}>
3031
<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))
3233
})}>{item.name}</Link>
3334
</li>
3435
))}

0 commit comments

Comments
 (0)