wiki_pages/show: fix <meta> description tag.

Use an excerpt of the first paragraph rather than the entire page.
This commit is contained in:
evazion
2020-01-12 18:52:25 -06:00
parent 50c6840be3
commit f2269d39a7
4 changed files with 7 additions and 6 deletions

View File

@@ -1,4 +1,9 @@
module WikiPagesHelper
def wiki_page_excerpt(wiki_page)
text = strip_dtext(wiki_page.body).split(/\r\n|\r|\n/).first
truncate(text, length: 160)
end
def wiki_page_other_names_list(wiki_page)
names_html = wiki_page.other_names.map {|name| link_to(name, "http://www.pixiv.net/search.php?s_mode=s_tag_full&word=#{u(name)}", :class => "wiki-other-name")}
names_html.join(" ").html_safe