diff --git a/app/views/posts/partials/index/_seo_meta_tags.html.erb b/app/views/posts/partials/index/_seo_meta_tags.html.erb index bcf79a11b..00be2290b 100644 --- a/app/views/posts/partials/index/_seo_meta_tags.html.erb +++ b/app/views/posts/partials/index/_seo_meta_tags.html.erb @@ -1,10 +1,10 @@ -<% if @post_set.tag_string.present? %> - <% "#{@post_set.humanized_tag_string} - #{Danbooru.config.app_name}".tap do |title| %> +<% if @post_set.is_single_tag? %> + <% "#{@post_set.humanized_tag_string.titleize} - #{Danbooru.config.app_name}".tap do |title| %> <%= tag.meta name: "og:title", content: title %> <%= tag.meta name: "twitter:title", content: title %> <% end %> <% else %> - <% Danbooru.config.description.tap do |title| %> + <% "#{@post_set.humanized_tag_string} - #{Danbooru.config.app_name}".tap do |title| %> <%= tag.meta name: "og:title", content: title %> <%= tag.meta name: "twitter:title", content: title %> <% end %> @@ -20,14 +20,8 @@ <%= tag.meta name: "canonical", content: posts_url(tags: params[:tags], host: Danbooru.config.hostname, protocol: "https") %> -<% if @post_set.has_wiki_text? %> - <% strip_dtext(truncate(@post_set.wiki_page.presenter.excerpt, length: 350)).tap do |desc| %> - <%= tag.meta name: "description", content: desc %> - <%= tag.meta name: "og:description", content: desc %> - <%= tag.meta name: "twitter:description", content: desc %> - <% end %> -<% elsif @post_set.is_single_tag? %> - <% "Find the best art of #{params[:tags].tr('_', ' ').titleize} on #{Danbooru.config.app_name}".tap do |desc| %> +<% if @post_set.is_single_tag? %> + <% "Find #{@post_set.post_count} images of #{@post_set.humanized_tag_string.titleize} on #{Danbooru.config.app_name}".tap do |desc| %> <%= tag.meta name: "description", content: desc %> <%= tag.meta name: "og:description", content: desc %> <%= tag.meta name: "twitter:description", content: desc %> diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 35c6362f7..54e2e8004 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -156,14 +156,14 @@ <% end %> <% 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" %> - + <%= tag.meta name: "og:title", content: "#{@post.presenter.humanized_essential_tag_string} - #{Danbooru.config.app_name}" %> <% if @post.visible? %> - + <%= tag.meta name: "og:image", content: @post.open_graph_image_url %> <% end %> <% if Danbooru.config.enable_post_search_counts %> @@ -175,12 +175,12 @@ <%# Twitter properties %> <% if @post.twitter_card_supported? %> - - - + <%= tag.meta name: "twitter:site", content: Danbooru.config.twitter_site %> + <%= tag.meta name: "twitter:title", content: "#{@post.presenter.humanized_essential_tag_string} - #{Danbooru.config.app_name}" %> + <%= 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 %> <% end %> <% end %>