[#169] Add a ROBOTS meta tag to several forms to hide from web spiders
Based on the patch by Yuki Sonoda
This commit is contained in:
parent
7973847e11
commit
705bd74378
|
@ -899,6 +899,14 @@ module ApplicationHelper
|
||||||
"<link rel='shortcut icon' href='#{image_path('/favicon.ico')}' />"
|
"<link rel='shortcut icon' href='#{image_path('/favicon.ico')}' />"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Add a HTML meta tag to control robots (web spiders)
|
||||||
|
#
|
||||||
|
# @param [optional, String] content the content of the ROBOTS tag.
|
||||||
|
# defaults to no index, follow, and no archive
|
||||||
|
def robot_exclusion_tag(content="NOINDEX,FOLLOW,NOARCHIVE")
|
||||||
|
"<meta name='ROBOTS' content='#{h(content)}' />"
|
||||||
|
end
|
||||||
|
|
||||||
# Returns true if arg is expected in the API response
|
# Returns true if arg is expected in the API response
|
||||||
def include_in_api_response?(arg)
|
def include_in_api_response?(arg)
|
||||||
unless @included_in_api_response
|
unless @included_in_api_response
|
||||||
|
|
|
@ -74,3 +74,6 @@
|
||||||
<%= submit_tag l(:button_move_and_follow), :name => 'follow' %>
|
<%= submit_tag l(:button_move_and_follow), :name => 'follow' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= robot_exclusion_tag %>
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
<h2><%=h "#{@issue.tracker.name} ##{@issue.id}" %></h2>
|
<h2><%=h "#{@issue.tracker.name} ##{@issue.id}" %></h2>
|
||||||
|
|
||||||
<%= render :partial => 'edit' %>
|
<%= render :partial => 'edit' %>
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= robot_exclusion_tag %>
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -23,4 +23,5 @@
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= stylesheet_link_tag 'scm' %>
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
|
<%= robot_exclusion_tag %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= stylesheet_link_tag 'scm' %>
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
|
<%= robot_exclusion_tag %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% html_title @page.pretty_title %>
|
<% html_title @page.pretty_title %>
|
||||||
|
|
Loading…
Reference in New Issue