From 67287f4b0960906cee6e63f509ca4eb6a2a626fd Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Sat, 9 Mar 2024 23:47:55 +0100 Subject: [PATCH] Fix broken homepage scroll links from other pages --- astro.config.mjs | 4 ++-- src/components/Menu.astro | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index faff7683..8e28fdda 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -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", }, }, }); diff --git a/src/components/Menu.astro b/src/components/Menu.astro index 5968bde8..4a7b6b2d 100644 --- a/src/components/Menu.astro +++ b/src/components/Menu.astro @@ -1,10 +1,12 @@ --- const currentPath = Astro.url.pathname; +const isHomepage = currentPath === "/" || currentPath === "/index.html"; +const homeScroll = isHomepage ? 'class="scroll"' : ""; ---