diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c6d88487fdf7512a146f77d92944414e08bd9f21..b498936da14949374d262b565be508ba433dd8ad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -898,6 +898,14 @@ module ApplicationHelper def favicon "<link rel='shortcut icon' href='#{image_path('/favicon.ico')}' />" 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 def include_in_api_response?(arg) diff --git a/app/views/issue_moves/new.rhtml b/app/views/issue_moves/new.rhtml index cd6044052c98c9254b8b1db9e94016faf73011a1..6f2935e10f1fff6459e9051eb9a5ec140adcc556 100644 --- a/app/views/issue_moves/new.rhtml +++ b/app/views/issue_moves/new.rhtml @@ -74,3 +74,6 @@ <%= submit_tag l(:button_move_and_follow), :name => 'follow' %> <% end %> <% end %> +<% content_for :header_tags do %> + <%= robot_exclusion_tag %> +<% end %> diff --git a/app/views/issues/edit.rhtml b/app/views/issues/edit.rhtml index 97f26a205558e4d5c35a1246a8a43573c55ee960..33267e7e02a891f9b6cb24a028f73683118570d0 100644 --- a/app/views/issues/edit.rhtml +++ b/app/views/issues/edit.rhtml @@ -1,3 +1,6 @@ <h2><%=h "#{@issue.tracker.name} ##{@issue.id}" %></h2> <%= render :partial => 'edit' %> +<% content_for :header_tags do %> + <%= robot_exclusion_tag %> +<% end %> diff --git a/app/views/issues/new.rhtml b/app/views/issues/new.rhtml index 13992382f9bfd9cb5980662d3fef3a81d0d6a54f..867590fa290d0a7a3be6839dbdaf5752a1f4a7cf 100644 --- a/app/views/issues/new.rhtml +++ b/app/views/issues/new.rhtml @@ -23,4 +23,5 @@ <% content_for :header_tags do %> <%= stylesheet_link_tag 'scm' %> + <%= robot_exclusion_tag %> <% end %> diff --git a/app/views/wiki/edit.rhtml b/app/views/wiki/edit.rhtml index 2615075e26bd0250592798a9715ac57ead780896..5f47c3f8cc0e052b18b75946db399d9a249d20a2 100644 --- a/app/views/wiki/edit.rhtml +++ b/app/views/wiki/edit.rhtml @@ -23,6 +23,7 @@ <% content_for :header_tags do %> <%= stylesheet_link_tag 'scm' %> + <%= robot_exclusion_tag %> <% end %> <% html_title @page.pretty_title %>