Skip to content

Commit

Permalink
fix(nuxt3): github return open graph url
Browse files Browse the repository at this point in the history
  • Loading branch information
LarchLiu committed May 10, 2023
1 parent 484ea9d commit a4810ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/nuxt3/server/api/webcard.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export default eventHandler(async (event) => {
const res = await unfurl(webInfo.url)

if (webMeta.website === 'Github') {
//
if (res.open_graph && res.open_graph.images) {
return {
url: res.open_graph.images[0].url,
}
}
}
else if (webMeta.website === 'Twitter') {
meta = webMeta as TwitterTweetMeta
Expand Down

0 comments on commit a4810ca

Please sign in to comment.