Skip to content

Commit

Permalink
Add a max-width to the HeaderNav
Browse files Browse the repository at this point in the history
  • Loading branch information
fwextensions committed Jan 18, 2024
1 parent ce789b5 commit 0453dcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/astro/src/components/HeaderNav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const routes = [
];
// 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
// any trailing slash so currentPage can match the pages above
const fullPath = Astro.url.pathname.replace(/\/$/, "");
const currentPath = fullPath.slice(fullPath.lastIndexOf("/") + 1);
const currentPage = fullPath.slice(fullPath.lastIndexOf("/") + 1);
---

<nav class="container-fluid">
<nav class="container">
<ul>
<li>
<a href="./" class="contrast">
Expand All @@ -25,9 +25,9 @@ const currentPath = fullPath.slice(fullPath.lastIndexOf("/") + 1);
</ul>
<ul>
{
routes.map(([path, name]) => (
routes.map(([page, label]) => (
<li>
<a href={path} aria-current={currentPath === path ? "page" : false}>{name}</a>
<a href={page} aria-current={currentPage === page ? "page" : false}>{label}</a>
</li>
))
}
Expand Down

0 comments on commit 0453dcf

Please sign in to comment.