Skip to content
Snippets Groups Projects
Commit ca67b630 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Load ogImage or twitterImage from urls

parent 1820544f
No related branches found
No related tags found
No related merge requests found
<template name="oembedImageWidget">
<a href="{{url}}">
<a href="{{url}}" target="_blank">
{{#if parsedUrl}}
<blockquote>
<img src="{{url}}" height="200" />
......
......@@ -3,4 +3,10 @@ Template.oembedUrlWidget.helpers
if not this.meta?
return
return this.meta['ogDescription'] or this.meta['description']
\ No newline at end of file
return this.meta['ogDescription'] or this.meta['description']
image: ->
if not this.meta?
return
return this.meta['ogImage'] or this.meta['twitterImage']
\ No newline at end of file
<template name="oembedUrlWidget">
<a href="{{url}}">{{url}}</a>
<a href="{{url}}" target="_blank">{{url}}</a>
{{#if parsedUrl}}
<blockquote>
<a href="{{url}}">{{parsedUrl.host}}</a>
<a href="{{url}}" target="_blank">{{parsedUrl.host}}</a>
{{#if description}}
<br/>
{{description}}
<div style="{{#if image}}min-height: 50px;{{/if}}">
{{#if image}}
{{#if meta.ogImageUserGenerated}}
<div>
<a href="{{url}}" target="_blank">
<img src="{{image}}" height="200" />
</a>
</div>
{{else}}
<a href="{{url}}" target="_blank">
<img src="{{image}}" height="50" align="left" style="margin-right: 5px;"/>
</a>
{{/if}}
{{/if}}
{{description}}
</div>
{{/if}}
</blockquote>
{{/if}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment