make the embed tags have a bit more length
This commit is contained in:
parent
8b50f80875
commit
a008aaeba8
2 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
module OpenGraphHelper
|
||||
def og_title(post)
|
||||
meta_tag_with_property('og:title', post_page_title(post))
|
||||
meta_tag_with_property('og:title', post_page_title(post, :length => 140))
|
||||
end
|
||||
|
||||
def og_type(post)
|
||||
|
|
@ -23,7 +23,7 @@ module OpenGraphHelper
|
|||
end
|
||||
|
||||
def og_description(post)
|
||||
meta_tag_with_property('og:description', post_page_title(post))
|
||||
meta_tag_with_property('og:description', post_page_title(post, :length => 1000))
|
||||
end
|
||||
|
||||
def og_page_specific_tags(post)
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
# the COPYRIGHT file.
|
||||
|
||||
module PostsHelper
|
||||
def post_page_title(post)
|
||||
def post_page_title(post, opts={})
|
||||
if post.is_a?(Photo)
|
||||
I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message.author.name
|
||||
elsif post.is_a?(Reshare)
|
||||
I18n.t "posts.show.reshare_by", :author => post.author.name
|
||||
else
|
||||
if post.text.present?
|
||||
truncate(post.text(:plain_text => true), :length => 20)
|
||||
truncate(post.text(:plain_text => true), :length => opts.fetch(:length, 20))
|
||||
elsif post.respond_to?(:photos) && post.photos.present?
|
||||
I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author.name
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue