Skip to content

Commit

Permalink
Fix immages
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPower committed May 4, 2024
1 parent 68a5de8 commit 457a599
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/components/Image.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
export let src: string;
export let alt: string;
const path = `/src/lib/assets/${src}`;
const original = import.meta.glob<{ default: string }>("$lib/assets/*", {
eager: true,
})[path]?.default!;
const thumbnail = import.meta.glob<{ default: string }>("$lib/assets/*", {
query: "?full",
query: "?w=960&format=webp&quality=80",
eager: true,
})[path]?.default!;
</script>

<figure>
<a href={path}>
<a href={original}>
<img src={thumbnail} {alt} />
</a>
{#if $$slots.default}
Expand Down

0 comments on commit 457a599

Please sign in to comment.