discourse/lib/onebox/templates/discourse_user_onebox.mustache
jbrw 331236d6d7
Onebox improved error handling and support for Instagram Access Tokens (#11253)
* FEATURE: display error if Oneboxing fails due to HTTP error

- display warning if onebox URL is unresolvable
- display warning if attributes are missing

* FEATURE: Use new Instagram oEmbed endpoint if access token is configured

Instagram requires an Access Token to access their oEmbed endpoint. The requirements (from https://developers.facebook.com/docs/instagram/oembed/) are as follows:

- a Facebook Developer account, which you can create at developers.facebook.com
- a registered Facebook app
- the oEmbed Product added to the app
- an Access Token
- The Facebook app must be in Live Mode

The generated Access Token, once added to SiteSetting.facebook_app_access_token, will be passed to onebox. Onebox can then use this token to access the oEmbed endpoint to generate a onebox for Instagram.

* DEV: update user agent string

* DEV: don’t do HEAD requests against news.yahoo.com

* DEV: Bump onebox version from 2.1.5 to 2.1.6

* DEV: Avoid re-reading templates

* DEV: Tweaks to onebox mustache templates

* DEV: simplified error message for missing onebox data

* Apply suggestions from code review
Co-authored-by: Gerhard Schlager <mail@gerhard-schlager.at>
2020-11-18 12:55:16 -05:00

33 lines
966 B
Plaintext

<aside class="onebox">
<article class="onebox-body user-onebox">
{{{avatar}}}
<h3><a href="{{original_url}}">{{{username}}}</a></h3>
<div>
{{#name}}
<span class="full-name">{{name}}</span>
{{/name}}
{{#location}}
<span class="location">
<svg class="fa d-icon d-icon-map-marker-alt svg-icon" xmlns="http://www.w3.org/2000/svg">
<use xlink:href="#map-marker-alt"></use>
</svg>
{{{location}}}
</span>
{{/location}}
{{#website}}
<span>
<svg class="fa d-icon d-icon-globe-americas svg-icon" xmlns="http://www.w3.org/2000/svg">
<use xlink:href="#globe-americas"></use>
</svg>
<a href="{{website}}">{{{website_name}}}</a>
</span>
{{/website}}
</div>
{{#bio}}
<p>{{{bio}}}</p>
{{/bio}}
<span>{{joined}} {{created_at}}</span>
</article>
<div class="clearfix"></div>
</aside>