File tree Expand file tree Collapse file tree 5 files changed +5
-7
lines changed Expand file tree Collapse file tree 5 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import "../styles/shiki-highlight.css"
55import BaseHead from " ../components/BaseHead.astro"
66import BlogPost from " ../components/BlogPost.astro"
77import BaseTopOfBody from " src/components/BaseTopOfBody.astro"
8+ import path from " path"
89
910const { content } = Astro .props
1011const {
@@ -20,7 +21,7 @@ const url = Astro.request.url
2021
2122<html lang ={ content .lang || " en" } >
2223 <head >
23- <BaseHead {title } {description } permalink ={ url } image =" /og.webp " />
24+ <BaseHead {title } {description } permalink ={ url } image ={ new URL ( ` ${ Astro . url . pathname } /og.jpg ` , Astro . url ). toString () } />
2425 </head >
2526
2627 <body >
File renamed without changes.
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ interface MarkdownFrontmatter {
2020// All variables are available to use in the HTML template below.
2121let title = " Web Dev Simplified Blog"
2222let description = " In depth articles with interactive examples about every web dev topic."
23- let permalink = " https://blog.webdevsimplified.com"
2423
2524// Data Fetching: List all Markdown posts in the repo.
2625
@@ -42,15 +41,13 @@ const allPosts = allMarkdownPosts
4241 return bDate - aDate
4342 })
4443
45- const url = Astro .request .url
46-
4744// Full Astro Component Syntax:
4845// https://docs.astro.build/core-concepts/astro-components/
4946---
5047
5148<html lang =" en" >
5249 <head >
53- <BaseHead {title } {description } { permalink } image =" /og.webp " />
50+ <BaseHead {title } {description } permalink = { Astro . url . toString () } image ={ new URL ( " /og.jpg " , Astro . url ). toString () } />
5451
5552 <style >
5653 .content {
File renamed without changes.
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ export async function generateOpenGraphImage({
164164 satoriOptions ,
165165 )
166166
167- const webp = await sharp ( Buffer . from ( svg ) ) . webp ( { quality : 100 } ) . toBuffer ( )
167+ const jpg = await sharp ( Buffer . from ( svg ) ) . jpeg ( { quality : 100 } ) . toBuffer ( )
168168
169- return new Response ( webp , { headers : { "Content-Type" : "image/webp " } } )
169+ return new Response ( jpg , { headers : { "Content-Type" : "image/jpg " } } )
170170}
You can’t perform that action at this time.
0 commit comments