Skip to content

Commit

Permalink
Fix broken homepage scroll links from other pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels committed Mar 9, 2024
1 parent 30b9d85 commit 67287f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default defineConfig({
markdown: {
shikiConfig: {
// Choose from Shiki's built-in themes (or add your own)
// https://github.com/shikijs/shiki/blob/main/docs/themes.md
theme: "min-light",
// https://shiki.style/themes
theme: "light-plus",
},
},
});
14 changes: 8 additions & 6 deletions src/components/Menu.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
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">
{
(currentPath === "/" || currentPath === "/index.html") && (
isHomepage && (
<a href="https://github.com/nextflow-io/nextflow" target="_blank" class="hidden-xs">
<img
style="position: absolute; top: 0; right: 0; border: 0;"
Expand All @@ -22,17 +24,17 @@ const currentPath = Astro.url.pathname;
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/index.html" style="padding: 15px"
><img src="/img/nextflow.svg" height="35px" style="border: 0;" /></a
>
<a class="navbar-brand" href="/index.html" style="padding: 15px">
<img src="/img/nextflow.svg" height="35px" style="border: 0;" />
</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="show animated flipInX">
<a href="/index.html#Features" class="scroll">Features</a>
<a href="/index.html#Features" {homeScroll}>Features</a>
</li>
<li class="show animated flipInX">
<a href="/index.html#GetStarted" class="scroll">Quick start</a>
<a href="/index.html#GetStarted" {homeScroll}>Quick start</a>
</li>

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

0 comments on commit 67287f4

Please sign in to comment.