Skip to content

Commit b44f308

Browse files
committed
fix: minor improvements
1 parent 5d4c8f3 commit b44f308

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/components/ui/Avatar.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
import { Image } from 'astro:assets';
3+
import { getImage } from 'astro:assets';
34
import { DEFAULT_CONFIGURATION } from '@/lib/constants'
45
56
interface Props {
67
class?: string;
78
}
89
const { class: className } = Astro.props;
10+
11+
const image = await getImage({ src: DEFAULT_CONFIGURATION.author.avatar, format: 'avif'});
912
---
1013

1114
<div class:list={[
@@ -14,7 +17,7 @@ const { class: className } = Astro.props;
1417
]}>
1518
<Image
1619
loading="eager"
17-
src={DEFAULT_CONFIGURATION.author.avatar.src}
20+
src={image.src}
1821
alt={DEFAULT_CONFIGURATION.author.name}
1922
width={52}
2023
height={52}

src/pages/writing/[...slug].astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ const { Content } = await render(entry);
3636
{entry.data.image && (
3737
<div class="relative aspect-video overflow-hidden rounded-lg">
3838
<Image
39-
src={entry.data.image?.src}
39+
src={entry.data.image}
4040
alt={entry.data.title}
41-
width={entry.data.image?.width}
42-
height={entry.data.image?.height}
4341
class="object-cover"
4442
/>
4543
</div>

0 commit comments

Comments
 (0)