From 1ba545858eac901ee3bb9c1a99fa3acf00fe386b Mon Sep 17 00:00:00 2001
From: HJfod <60038575+HJfod@users.noreply.github.com>
Date: Mon, 4 Mar 2024 16:02:30 +0200
Subject: [PATCH] fix links pt. 2
---
src/components/Button.astro | 2 +-
src/components/Link.astro | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/Button.astro b/src/components/Button.astro
index 10ac7a2..463989a 100644
--- a/src/components/Button.astro
+++ b/src/components/Button.astro
@@ -1,6 +1,6 @@
---
const { link, style } = Astro.props;
-const url = `${import.meta.env.BASE_URL}${link}`;
+const url = link.startsWith('https') ? link : `${import.meta.env.BASE_URL}${link}`;
---
diff --git a/src/components/Link.astro b/src/components/Link.astro
index 49159b8..20c5ac7 100644
--- a/src/components/Link.astro
+++ b/src/components/Link.astro
@@ -1,7 +1,7 @@
---
const { href, style, noUnderline } = Astro.props;
const classList = `${style} ${noUnderline === 'true' ? 'no-link-underline' : ''}`;
-const url = `${import.meta.env.BASE_URL}${href}`;
+const url = href.startsWith('https') ? href : `${import.meta.env.BASE_URL}${href}`;
---