Skip to content

Commit

Permalink
Fix homepage scroll nav links
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Mar 10, 2024
1 parent 67287f4 commit 7c66cd3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Menu.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
const currentPath = Astro.url.pathname;
const isHomepage = currentPath === "/" || currentPath === "/index.html";
const homeScroll = isHomepage ? 'class="scroll"' : "";
---

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
Expand Down Expand Up @@ -31,10 +30,10 @@ const homeScroll = isHomepage ? 'class="scroll"' : "";
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="show animated flipInX">
<a href="/index.html#Features" {homeScroll}>Features</a>
<a href="/index.html#Features" class={isHomepage && "scroll"}>Features</a>
</li>
<li class="show animated flipInX">
<a href="/index.html#GetStarted" {homeScroll}>Quick start</a>
<a href="/index.html#GetStarted" class={isHomepage && "scroll"}>Quick start</a>
</li>

<li class="show animated flipInX">
Expand Down

0 comments on commit 7c66cd3

Please sign in to comment.