artists: prevent Google from indexing banned artists.
Prevent search engines from indexing artist pages, wiki pages, and tag searches for banned artists.
This commit is contained in:
@@ -362,6 +362,10 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def noindex
|
||||
content_for(:html_header, tag.meta(name: "robots", content: "noindex"))
|
||||
end
|
||||
|
||||
def atom_feed_tag(title, url = {})
|
||||
content_for(:html_header, auto_discovery_link_tag(:atom, url, title: title))
|
||||
end
|
||||
|
||||
@@ -122,6 +122,7 @@ module PostSets
|
||||
|
||||
def hide_from_crawler?
|
||||
return true if current_page > 50
|
||||
return true if artist.present? && artist.is_banned?
|
||||
return false if query.is_empty_search? || query.is_simple_tag? || query.is_metatag?(:order, :rank)
|
||||
true
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% noindex if @artist.is_banned? %>
|
||||
|
||||
<%= render layout: "show" do %>
|
||||
<div>
|
||||
<%= render "summary", artist: @artist %>
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
<% canonical_url root_url(host: Danbooru.config.hostname) %>
|
||||
<% end %>
|
||||
|
||||
<% if @post_set.hide_from_crawler? %>
|
||||
<meta name="robots" content="nofollow,noindex">
|
||||
<% end %>
|
||||
<% noindex if @post_set.hide_from_crawler? %>
|
||||
|
||||
<% if @post_set.has_explicit? %>
|
||||
<meta name="rating" content="adult">
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<% page_title "#{@wiki_page.pretty_title.titleize} Wiki" %>
|
||||
<% meta_description DText.excerpt(@wiki_page.body) %>
|
||||
|
||||
<% if @wiki_page.artist.present? && @wiki_page.artist.is_banned? %>
|
||||
<% noindex %>
|
||||
<% end %>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
<%= render "sidebar" %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user