Skip to content

Commit 5fb9ce8

Browse files
Fix Final Time
1 parent 471f726 commit 5fb9ce8

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

src/layouts/BlogPost.astro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ const url = Astro.request.url
2121

2222
<html lang={content.lang || "en"}>
2323
<head>
24-
<BaseHead {title} {description} permalink={url} image={new URL(path.join(`${Astro.url.pathname}/og.jpg`), Astro.url).toString()} />
24+
<BaseHead
25+
{title}
26+
{description}
27+
permalink={url}
28+
image={new URL(
29+
path.join(Astro.url.pathname, "og.jpg"),
30+
Astro.url,
31+
).toString()}
32+
/>
2533
</head>
2634

2735
<body>
File renamed without changes.

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const allPosts = allMarkdownPosts
5252
{title}
5353
{description}
5454
permalink={Astro.url.toString()}
55-
image={new URL("/og.", Astro.url).toString()}
55+
image={new URL("/og.webp", Astro.url).toString()}
5656
/>
5757

5858
<style>
File renamed without changes.

src/utils/generateOpenGraphImage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export async function generateOpenGraphImage({
164164
satoriOptions,
165165
)
166166

167-
const jpg = await sharp(Buffer.from(svg)).jpeg({ quality: 90 }).toBuffer()
167+
const webp = await sharp(Buffer.from(svg)).webp({ quality: 90 }).toBuffer()
168168

169-
return new Response(jpg, { headers: { "Content-Type": "image/jpg" } })
169+
return new Response(webp, { headers: { "Content-Type": "image/webp" } })
170170
}

0 commit comments

Comments
 (0)