From 0225e2e17d12a32467bc12f33b2402287c79e23f Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:27:36 +0100 Subject: Fixed icon system --- apps/website/src/components/logos/Logo.astro | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apps/website/src/components/logos') diff --git a/apps/website/src/components/logos/Logo.astro b/apps/website/src/components/logos/Logo.astro index 7988092..6b085fa 100644 --- a/apps/website/src/components/logos/Logo.astro +++ b/apps/website/src/components/logos/Logo.astro @@ -1,4 +1,6 @@ --- +import { readFile } from 'node:fs/promises'; +import { join } from 'node:path'; import type { LogoType } from '@webtypes/Config'; import type { HTMLAttributes } from 'astro/types'; @@ -18,8 +20,9 @@ let svg: string | undefined; try { if (logo === undefined) return; - const dir = '../../../public/media'; - svg = (await import(/* @vite-ignore */ `${dir}/${logo.replaceAll('.', '/')}.svg?raw`)).default; + + const dir = new URL(join('..', '..', '..', 'public', 'media'), import.meta.url).pathname; + svg = (await readFile(`${dir}/${logo.replaceAll('.', '/')}.svg`, { encoding: 'utf8' })); if (svg === undefined) return; -- cgit