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
|
module OpenGraphHelper
|
||||||
def og_title(post)
|
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
|
end
|
||||||
|
|
||||||
def og_type(post)
|
def og_type(post)
|
||||||
|
|
@ -23,7 +23,7 @@ module OpenGraphHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def og_description(post)
|
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
|
end
|
||||||
|
|
||||||
def og_page_specific_tags(post)
|
def og_page_specific_tags(post)
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
module PostsHelper
|
module PostsHelper
|
||||||
def post_page_title(post)
|
def post_page_title(post, opts={})
|
||||||
if post.is_a?(Photo)
|
if post.is_a?(Photo)
|
||||||
I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message.author.name
|
I18n.t "posts.show.photos_by", :count => 1, :author => post.status_message.author.name
|
||||||
elsif post.is_a?(Reshare)
|
elsif post.is_a?(Reshare)
|
||||||
I18n.t "posts.show.reshare_by", :author => post.author.name
|
I18n.t "posts.show.reshare_by", :author => post.author.name
|
||||||
else
|
else
|
||||||
if post.text.present?
|
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?
|
elsif post.respond_to?(:photos) && post.photos.present?
|
||||||
I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author.name
|
I18n.t "posts.show.photos_by", :count => post.photos.size, :author => post.author.name
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue