views: adjust more <meta> descriptions.

* Add <meta> descriptions to more pages.
* Adjust wiki/pool/forum pages to use an excerpt of the first paragraph.
This commit is contained in:
evazion
2020-01-26 14:38:08 -06:00
parent fbe39148cd
commit 815703a922
22 changed files with 42 additions and 36 deletions

View File

@@ -262,9 +262,13 @@ class DText
end
# extract the first paragraph `needle` occurs in.
def self.excerpt(dtext, needle)
def self.extract_mention(dtext, needle)
dtext = dtext.gsub(/\r\n|\r|\n/, "\n")
excerpt = ActionController::Base.helpers.excerpt(dtext, needle, separator: "\n\n", radius: 1, omission: "")
excerpt
end
def self.excerpt(text, length: 160)
strip_dtext(text).split(/\r\n|\r|\n/).first.to_s.truncate(length)
end
end