FEATURE: omit images from og and twitter description tags

This commit is contained in:
Gerhard Schlager
2017-11-28 12:27:43 +01:00
parent 04e8b7dffb
commit 44ee388070
6 changed files with 32 additions and 17 deletions

View File

@@ -169,10 +169,10 @@ class TopicView
@desired_post
end
def summary
def summary(opts = {})
return nil if desired_post.blank?
# TODO, this is actually quite slow, should be cached in the post table
excerpt = desired_post.excerpt(500, strip_links: true, text_entities: true)
excerpt = desired_post.excerpt(500, opts.merge(strip_links: true, text_entities: true))
(excerpt || "").gsub(/\n/, ' ').strip
end