Skip to content

Commit

Permalink
open graph preview
Browse files Browse the repository at this point in the history
  • Loading branch information
chibat committed Dec 16, 2023
1 parent 7b4a996 commit b9ee739
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class Renderer extends Marked.Renderer {
return youtubeTag;
}
}
if (text === "_preview") {
return `<iframe src="https://ogp.deno.dev/?size=large&url=${
encodeURI(href)
}" height="350" width="500"></iframe>`;
}
return `<a href="${href}" title="${title}" rel="noopener noreferrer" target="_blank">${text}</a>`;
}
}
Expand Down

0 comments on commit b9ee739

Please sign in to comment.