add more og markup; send over large image re FB's request
This commit is contained in:
parent
73c91463f9
commit
bec7b96de7
1 changed files with 8 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ module OpenGraphHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def og_image(post)
|
def og_image(post)
|
||||||
tags = post.photos.map{|x| meta_tag_with_property('og:image', x.url(:thumb_small))}
|
tags = post.photos.map{|x| meta_tag_with_property('og:image', x.url(:thumb_large))}
|
||||||
tags << meta_tag_with_property('og:image', "#{root_url.chop}#{image_path('asterisk.png')}") if tags.empty?
|
tags << meta_tag_with_property('og:image', "#{root_url.chop}#{image_path('asterisk.png')}") if tags.empty?
|
||||||
tags.join(' ')
|
tags.join(' ')
|
||||||
end
|
end
|
||||||
|
|
@ -25,8 +25,13 @@ module OpenGraphHelper
|
||||||
meta_tag_with_property('og:description', post_page_title(post, :length => 1000))
|
meta_tag_with_property('og:description', post_page_title(post, :length => 1000))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def og_type
|
||||||
|
# the diaspora og namespace was already taken :(
|
||||||
|
meta_tag_with_property('og:type', 'joindiaspora:post')
|
||||||
|
end
|
||||||
|
|
||||||
def og_page_specific_tags(post)
|
def og_page_specific_tags(post)
|
||||||
[og_title(post), og_type(post),
|
[og_title(post), og_type,
|
||||||
og_url(post), og_image(post),
|
og_url(post), og_image(post),
|
||||||
og_description(post)].join(' ').html_safe
|
og_description(post)].join(' ').html_safe
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue