Skip to content

Commit

Permalink
Block search engines and remove redundant <main> element from error p…
Browse files Browse the repository at this point in the history
…ages (#795)

* fix: block search engines

this is an internal service so we don't want it in google

* fix: remove extra main element from error pages

The main element and govuk-width-container div are already defined in
the base template.
  • Loading branch information
MatMoore committed Sep 9, 2024
1 parent 63c3023 commit e499263
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 47 deletions.
12 changes: 4 additions & 8 deletions templates/400.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@

{% block content %}

<div class="govuk-width-container">
<main class="govuk-main-wrapper govuk-main-wrapper--l" id="main-content" role="main">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
</div>
</div>
</main>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
</div>
</div>

{% endblock content %}
24 changes: 10 additions & 14 deletions templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@

{% block content %}

<div class="govuk-width-container">
<main class="govuk-main-wrapper govuk-main-wrapper--l" id="main-content" role="main">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
<p class="govuk-body">
{% translate "If you typed the web address, check it is correct." %}
</p>
<p class="govuk-body">
{% translate "If you pasted the web address, check you copied the entire address." %}
</p>
</div>
</div>
</main>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
<p class="govuk-body">
{% translate "If you typed the web address, check it is correct." %}
</p>
<p class="govuk-body">
{% translate "If you pasted the web address, check you copied the entire address." %}
</p>
</div>
</div>

{% endblock content %}
20 changes: 8 additions & 12 deletions templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@

{% block content %}

<div class="govuk-width-container">
<main class="govuk-main-wrapper govuk-main-wrapper--l" id="main-content" role="main">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
<p class="govuk-body">
{% translate "There is a problem with the server." %}
</p>
{% include "partial/contact_team.html" %}
</div>
</div>
</main>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
<p class="govuk-body">
{% translate "There is a problem with the server." %}
</p>
{% include "partial/contact_team.html" %}
</div>
</div>

{% endblock content %}
21 changes: 8 additions & 13 deletions templates/500_datahub_unavailable.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
{% load static %}

{% block content %}

<div class="govuk-width-container">
<main class="govuk-main-wrapper govuk-main-wrapper--l" id="main-content" role="main">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
<p class="govuk-body">
{% translate "The DataHub catalogue is currently unavailable. Please try again in a few minutes." %}
</p>
{% include "partial/contact_team.html" %}
</div>
</div>
</main>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">{{h1_value}}</h1>
<p class="govuk-body">
{% translate "The DataHub catalogue is currently unavailable. Please try again in a few minutes." %}
</p>
{% include "partial/contact_team.html" %}
</div>
</div>

{% endblock content %}
2 changes: 2 additions & 0 deletions templates/base/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load static %}
{% load page_title %}

<head>
<meta charset="utf-8">
<title>{{h1_value|render_title}}</title>
Expand All @@ -12,4 +13,5 @@
<link rel="manifest" href="{% static 'assets/manifest.json' %}">
<link rel="stylesheet" type="text/css" href="{% static 'assets/css/base.css' %}">
<meta property="og:image" content="{% static 'assets/images/govuk-opengraph-image.png' %}">
<meta name="robots" content="noindex, nofollow" />
</head>

0 comments on commit e499263

Please sign in to comment.