Skip to content

Commit

Permalink
Don't show banner content in google snippets
Browse files Browse the repository at this point in the history
Similar to alphagov/govuk_publishing_components#1185

Banners don't hold content specific to each page, so shouldn't be shown in
search results.

https://developers.google.com/search/reference/robots_meta_tag#data-nosnippet-attr
  • Loading branch information
sihugh committed Mar 30, 2020
1 parent 211ce40 commit 78c543a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/notifications/_emergency_banner.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="govuk-emergency-banner <%= banner.campaign_class %>" role="banner">
<div class="govuk-emergency-banner <%= banner.campaign_class %>" role="banner" data-nosnippet>
<div>
<h2><%= banner.heading %></h2>
<% if banner.short_description %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/notifications/_global_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</script>
<% end %>
<!--[if gt IE 7]><!-->
<div id="global-bar" class="<%= global_bar_classes.join(' ') %>" data-module="global-bar" <%= "data-global-bar-permanent=true" if always_visible %>>
<div id="global-bar" class="<%= global_bar_classes.join(' ') %>" data-module="global-bar" <%= "data-global-bar-permanent=true" if always_visible %> data-nosnippet>
<div class="global-bar-message govuk-width-container">
<% if title %>
<% if title_href %>
Expand Down

0 comments on commit 78c543a

Please sign in to comment.