proxy github gists and render them on posts

This commit is contained in:
realaravinth
2021-11-04 19:36:37 +05:30
parent 8e9b070d46
commit 072e30cba3
7 changed files with 167 additions and 1 deletions

View File

@ -44,7 +44,12 @@
<h6><.= p.text .></h6>
<.} else if p.type_ == "IFRAME" {.>
<. let src = &p.iframe.as_ref().unwrap().media_resource.as_ref().unwrap().href; .>
<. if src.contains("gist.github.com"){.>
<iframe src="<.= crate::V1_API_ROUTES.proxy.get_gist(&src) .>" frameborder="0"></iframe>
<a href="<.= src .>">Click here to open gist on GitHub</a>
<.} else {.>
<iframe src="<.= src .>" frameborder="0"></iframe>
<.}.>
<.}.>
<.}.>
</article>