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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user