include a default image in the og:image [ci skip]
This commit is contained in:
parent
a008aaeba8
commit
cdef049529
1 changed files with 2 additions and 4 deletions
|
|
@ -12,10 +12,8 @@ module OpenGraphHelper
|
|||
end
|
||||
|
||||
def og_image(post)
|
||||
if post.photos.present?
|
||||
img_url = post.photos.first.url(:thumb_medium)
|
||||
meta_tag_with_property('og:image', img_url)
|
||||
end
|
||||
img_url = post.photos.present? ? post.photos.first.url(:thumb_medium) : "#{root_url.chop}#{image_path('asterisk.png')}"
|
||||
meta_tag_with_property('og:image', img_url)
|
||||
end
|
||||
|
||||
def og_site_name
|
||||
|
|
|
|||
Loading…
Reference in a new issue