From 73b0af5c938b49ef0a4a21921b41a3b1bcd4e05e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sun, 16 Apr 2017 10:38:02 -0400 Subject: Simplify the og:image and og:description code in stream_entries/show (#1934) --- app/views/stream_entries/_og_image.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/views/stream_entries/_og_image.html.haml (limited to 'app/views/stream_entries/_og_image.html.haml') diff --git a/app/views/stream_entries/_og_image.html.haml b/app/views/stream_entries/_og_image.html.haml new file mode 100644 index 000000000..f725209d8 --- /dev/null +++ b/app/views/stream_entries/_og_image.html.haml @@ -0,0 +1,6 @@ +- if activity.is_a?(Status) && activity.non_sensitive_with_media? + %meta{ property: 'og:image', content: full_asset_url(activity.media_attachments.first.file.url(:small)) }/ +- else + %meta{ property: 'og:image', content: full_asset_url(account.avatar.url(:original)) }/ + %meta{ property: 'og:image:width', content: '120' }/ + %meta{ property: 'og:image:height', content: '120' }/ -- cgit