diff options
author | LynithDev <61880709+LynithDev@users.noreply.github.com> | 2024-01-20 11:27:36 +0100 |
---|---|---|
committer | LynithDev <61880709+LynithDev@users.noreply.github.com> | 2024-01-20 11:27:36 +0100 |
commit | 0225e2e17d12a32467bc12f33b2402287c79e23f (patch) | |
tree | 9d542217953eb915b3a4da9799fd24b723281054 /apps/website/src/components/icons | |
parent | 8be3434d32d7ed9046000377f7f9e59ef2a971b3 (diff) | |
download | Nexus-0225e2e17d12a32467bc12f33b2402287c79e23f.tar.gz Nexus-0225e2e17d12a32467bc12f33b2402287c79e23f.tar.bz2 Nexus-0225e2e17d12a32467bc12f33b2402287c79e23f.zip |
Fixed icon system
Diffstat (limited to 'apps/website/src/components/icons')
-rw-r--r-- | apps/website/src/components/icons/Icon.astro | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/website/src/components/icons/Icon.astro b/apps/website/src/components/icons/Icon.astro index b7442ab..f57ee4f 100644 --- a/apps/website/src/components/icons/Icon.astro +++ b/apps/website/src/components/icons/Icon.astro @@ -1,4 +1,5 @@ --- +import { readFile } from 'node:fs/promises'; import type { HTMLAttributes } from 'astro/types'; import { parse } from 'node-html-parser'; @@ -41,12 +42,13 @@ interface Props extends HTMLAttributes<'svg'> { } async function getSVG(name: string, path = 'impl') { - const file = await import(`./${path}/${name}.svg?raw`); + const dir = new URL(`${path}`, import.meta.url).pathname; + const file = await readFile(`${dir}/${name}.svg`, { encoding: 'utf-8' }); if (!file) throw new Error(`${name} not found`); - const content = parse(file.default); + const content = parse(file); const svg = content.querySelector('svg'); |