Skip to content

Commit cf32a40

Browse files
Update reference implementation of error pages and create documentation
1 parent 32f3e31 commit cf32a40

22 files changed

+656
-163
lines changed

_data/templates.json

Lines changed: 162 additions & 11 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sites/header/includes/header.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
</div>
1212
</div>
1313
{% unless page.layout == "application" %}
14+
{% unless page.layout == "servermessage" and page.isBilingual %}
1415
<hr>
16+
{% endunless %}
1517
<div class="container">
1618
<div class="row">
1719
{%- unless page.nomenu -%}

sites/layouts/gcds.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,7 @@
2323
{% include header/gcds-header.html %}
2424
<main {% unless page.noContainer %}class="container"{% endunless %}
2525
property="mainContentOfPage" resource="#wb-main" typeof="WebPageElement">
26-
27-
<!-- Check if the page has a hard coded h1 title -->
28-
{% assign normalizedContent = content | downcase %}
29-
{% assign hasH1Title = false %}
30-
{% if normalizedContent contains 'id="wb-cont"' %}
31-
{% assign hasH1Title = true %}
32-
{% endif %}
33-
<!-- Unless the page has a hard coded h1 title, include the main page title. -->
34-
{% unless hasH1Title %}
35-
{% include main-page-title/main-page-title.html %}
36-
{% endunless %}
26+
{% include main-page-title/conditional-page-title.html %}
3727
{{ content }}
3828
{% include page-details/footer.html addContainer=page.noContainer %}
3929

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- Check if the page has a hard coded h1 title -->
2+
{% assign normalizedContent = content | downcase %}
3+
{% assign hasH1Title = false %}
4+
{% if normalizedContent contains 'id="wb-cont"' %}
5+
{% assign hasH1Title = true %}
6+
{% endif %}
7+
<!-- Unless the page has a hard coded h1 title, include the main page title. -->
8+
{% unless hasH1Title %}
9+
{% include main-page-title/main-page-title.html %}
10+
{% endunless %}

templates/campaign/index.json-ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"title": {
1010
"en": "Campaign name",
11-
"fr": "Bêta - Message d'erreur serveur"
11+
"fr": "Nom de la campagne"
1212
},
1313
"description": {
1414
"en": "Campaign name templates samples",
15-
"fr": "Exemple de page d'erreur serveur."
15+
"fr": "Exemples de gabarits pour le nom de la campagne"
1616
},
1717
"modified": "2020-04-16",
1818
"componentName": "campaign",
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: "Page not found / Page non trouvée"
3+
language: "en"
4+
layout: servermessage
5+
nositesearch: true
6+
breadcrumbs: false
7+
nomenu: true
8+
isBilingual: true
9+
---
10+
<h1 class="wb-inv" id="wb-cont">Page not found / <span lang="fr">Page non trouvée</span></h1>
11+
<div class="col-md-12 mrgn-bttm-xl">
12+
<div class="row px-3 px-md-0">
13+
<!-- English section -->
14+
<div class="col-md-5 col-sm-12">
15+
<div class="row">
16+
<h2 id="en">Page not found</h2>
17+
<p><span class="label label-danger">404 error</span></p>
18+
<p class="hidden-xl hidden-md hidden-lg"><a href="#fr">Aller à la version française</a></p>
19+
<p>The page you’re looking for may have been moved or deleted. Check that the web address (URL) is spelled correctly. Do not include special characters or spaces in the URL.</p>
20+
<p>You may be looking for:</p>
21+
<ul>
22+
<li><a href="https://www.canada.ca/en.html">Canada.ca home page</a></li>
23+
<li><a href="https://www.canada.ca/en/services.html">Government of Canada services</a></li>
24+
<li><a href="https://www.canada.ca/en/contact.html">Contact the Government of Canada</a></li>
25+
<li><a href="https://www.canada.ca/en/government/sign-in-online-account.html">Sign in to an account</a></li>
26+
<li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li>
27+
<li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li>
28+
<li><a href="https://www.canada.ca/en/services/immigration-citizenship.html">Visit or immigrate to Canada</a></li>
29+
</ul>
30+
</div>
31+
<!-- English search -->
32+
<section class="col-md-12 mrgn-tp-md">
33+
<h3 class="wb-inv">Search</h3>
34+
<form action="https://www.canada.ca/en/sr/srb.html" method="get" name="cse-search-box" role="search" class="form-inline">
35+
<div class="input-group">
36+
<label for="wb-srch-q" class="wb-inv">Search website</label>
37+
<input id="wb-srch-q-fr" list="wb-srch-q-ac-fr" class="wb-srch-q form-control" name="q" type="search" value="" size="27" maxlength="150" placeholder="Search Canada.ca">
38+
<datalist id="wb-srch-q-ac-fr"></datalist>
39+
<span class="input-group-btn">
40+
<button type="submit" id="wb-srch-sub-fr" class="btn btn-primary btn-small" name="wb-srch-sub-fr">
41+
<span class="glyphicon glyphicon-search"></span>
42+
<span class="wb-inv">Search</span>
43+
</button>
44+
</span>
45+
</div>
46+
</form>
47+
</section>
48+
</div>
49+
<div class="col-md-1 col-sm-0"></div>
50+
<!-- French section -->
51+
<div class="col-md-5 col-sm-12">
52+
<section lang="fr">
53+
<div class="row">
54+
<h2 id="fr">Page non trouvée</h2>
55+
<p><span class="label label-danger">Erreur 404</span></p>
56+
<p class="hidden-xl hidden-md hidden-lg"><a href="#en">Go to the English version</a></p>
57+
<p>La page que vous souhaitez consulter a peut-être été déplacée ou supprimée. Assurez-vous que l’adresse Web (URL) est exacte. N’incluez pas de caractères spéciaux ni d’espaces dans l’URL.</p>
58+
<p>Vous cherchez peut-être l’une des pages suivantes :</p>
59+
<ul>
60+
<li><a href="https://www.canada.ca/fr.html">Page d'accueil de Canada.ca</a></li>
61+
<li><a href="https://www.canada.ca/fr/services.html">Services du gouvernement du Canada</a></li>
62+
<li><a href="https://www.canada.ca/fr/contact.html">Coordonnées du gouvernement du Canada</a></li>
63+
<li><a href="https://www.canada.ca/fr/gouvernement/ouvrir-session-dossier-compte-en-ligne.html">Se connecter à un dossier ou un compte en ligne</a></li>
64+
<li><a href="https://www.canada.ca/fr/services/prestations.html">Prestations</a></li>
65+
<li><a href="https://www.canada.ca/fr/services/impots.html">Impôts</a></li>
66+
<li><a href="https://www.canada.ca/fr/services/immigration-citoyennete.html">Immigration ou citoyenneté Canada</a></li>
67+
</ul>
68+
</div>
69+
</section>
70+
<!-- French search -->
71+
<section class="col-md-12 mrgn-tp-md">
72+
<h3 class="wb-inv">Recherche</h3>
73+
<form action="https://www.canada.ca/fr/sr/srb.html" method="get" name="cse-search-box" role="search" class="form-inline">
74+
<div class="input-group">
75+
<label for="wb-srch-q" class="wb-inv">Effectuer une recherche sur le site Web</label>
76+
<input id="wb-srch-q-fr" list="wb-srch-q-ac-fr" class="wb-srch-q form-control" name="q" type="search" value="" size="27" maxlength="150" placeholder="Rechercher dans Canada.ca">
77+
<datalist id="wb-srch-q-ac-fr"></datalist>
78+
<span class="input-group-btn">
79+
<button type="submit" id="wb-srch-sub-fr" class="btn btn-primary btn-small" name="wb-srch-sub-fr">
80+
<span class="glyphicon glyphicon-search"></span>
81+
<span class="wb-inv">Recherche</span>
82+
</button>
83+
</span>
84+
</div>
85+
</form>
86+
</section>
87+
</div>
88+
</div>
89+
</div>
90+
</div>

templates/servermessage/404-en-fr.md

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "Page not found"
3+
language: "en"
4+
altLangPage: "404-fr.html"
5+
layout: servermessage
6+
---
7+
<div class="px-3 px-sm-2 px-md-0 mrgn-bttm-xl">
8+
<p><span class="label label-danger">404 Error</span></p>
9+
<p>The page you're looking for may have been moved or deleted. Check that the web address (URL) is spelled correctly. Do not include special characters or spaces in the URL.</p>
10+
<p>You may be looking for:</p>
11+
<ul>
12+
<li><a href="https://www.canada.ca/en.html">Canada.ca home page</a></li>
13+
<li><a href="https://www.canada.ca/en/services.html">Government of Canada services</a></li>
14+
<li><a href="https://www.canada.ca/en/contact.html">Contact the Government of Canada</a></li>
15+
<li><a href="https://www.canada.ca/en/government/sign-in-online-account.html">Sign in to an account</a></li>
16+
<li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li>
17+
<li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li>
18+
<li><a href="https://www.canada.ca/en/services/immigration-citizenship.html">Visit or immigrate to Canada</a></li>
19+
<li><a href="https://www.canada.ca/en/sr/srb.html">Search Canada.ca</a></li>
20+
</ul>
21+
</div>

templates/servermessage/404-en.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)