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

@@ -3,7 +3,7 @@
<% meta_description("#{Danbooru.config.canonical_app_name} is the original anime image 'booru. Find over 3.75 million anime pictures categorized by over 100 million tags.") %>
<% else %>
<% page_title("#{@post_set.humanized_tag_string} Art") %>
<% meta_description("Find over #{number_with_delimiter(@post_set.post_count)} #{@post_set.humanized_tag_string} images on #{Danbooru.config.app_name}. #{wiki_page_excerpt(@post_set.wiki_page) if @post_set.wiki_page}") %>
<% meta_description("See over #{number_with_delimiter(@post_set.post_count)} #{@post_set.humanized_tag_string} images on #{Danbooru.config.app_name}. #{DText.excerpt(@post_set.wiki_page&.body)}") %>
<% end %>
<%= tag.link href: posts_path(format: "atom", tags: params[:tags]), rel: "alternate", title: "ATOM", type: "application/atom+xml" %>

View File

@@ -1,4 +1,6 @@
<% page_title @post.presenter.humanized_essential_tag_string %>
<% meta_description "View this #{@post.image_width}x#{@post.image_height} #{number_to_human_size(@post.file_size)} image" %>
<%= render "posts/partials/common/secondary_links" %>
<% content_for(:sidebar) do %>
@@ -155,7 +157,6 @@
<%= post_view_count_js %>
<% content_for(:html_header) do %>
<%= tag.meta name: "description", content: "View this #{@post.image_width}x#{@post.image_height} #{number_to_human_size(@post.file_size)} image" %>
<meta name="post-id" content="<%= @post.id %>">
<meta name="post-has-embedded-notes" content="<%= @post.has_embedded_notes? %>">
<meta name="always-resize-images" content="<%= CurrentUser.user.always_resize_images? %>">
@@ -174,7 +175,6 @@
<% if @post.twitter_card_supported? %>
<meta name="twitter:card" content="summary_large_image">
<%= tag.meta name: "twitter:site", content: Danbooru.config.twitter_site %>
<%= tag.meta name: "twitter:description", content: "View this #{@post.image_width}x#{@post.image_height} #{number_to_human_size(@post.file_size)} image" %>
<% if @post.visible? %>
<%= tag.meta name: "twitter:image", content: @post.open_graph_image_url %>