aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/logos
diff options
context:
space:
mode:
Diffstat (limited to 'apps/website/src/components/logos')
-rw-r--r--apps/website/src/components/logos/Logo.astro7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/website/src/components/logos/Logo.astro b/apps/website/src/components/logos/Logo.astro
index 2fd6bea..0b72b91 100644
--- a/apps/website/src/components/logos/Logo.astro
+++ b/apps/website/src/components/logos/Logo.astro
@@ -1,7 +1,5 @@
---
import type { LogoType } from "@webtypes/Config";
-import { dirname } from "path";
-import { fileURLToPath } from "url";
import type { HTMLAttributes } from "astro/types";
export interface Props extends HTMLAttributes<"svg"> {
@@ -20,7 +18,7 @@ let svg: string | undefined;
try {
if (logo == undefined) return;
- const dir = dirname(fileURLToPath(import.meta.url)) + "/../../../public/media";
+ const dir = "../../../public/media";
svg = (await import(`${dir}/${logo.replaceAll(".", "/")}.svg?raw` /* @vite-ignore */)).default;
if (svg == undefined) return;
@@ -44,7 +42,8 @@ try {
svg = svg.replace(/<svg/, `<svg ${Object.entries(attr).map(([key, value]) => `${key}="${value}"`).join(" ")}`);
} catch (err) {
-
+ console.error(`Error occurred while loading SVG. Logo name is ${logo}.`)
+ console.error(err);
}
---