Skip to content

Commit

Permalink
Fix path checking in HeaderNav.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
fwextensions committed Jan 12, 2024
1 parent 42e2c37 commit ba1572d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/astro/src/components/HeaderNav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const routes = [
["/donate", "Donate"],
["/about", "About"],
];
const currentPath = Astro.url.pathname;
// because of annoying differences between dev and build modes, due to this
// behavior (https://github.com/withastro/astro/issues/5630), always remove
// any trailing slash so currentPath can match the paths above
const currentPath = Astro.url.pathname.replace(/\/$/, "");
---

<nav class="container-fluid">
Expand Down

0 comments on commit ba1572d

Please sign in to comment.