Skip to content

Commit

Permalink
Merge pull request #423 from DEFRA/update-meta-data-seo
Browse files Browse the repository at this point in the history
Update meta data - SEO
  • Loading branch information
saranyavinayagam08 authored Jan 20, 2025
2 parents 9ca7577 + 5fdcd82 commit c2af892
Show file tree
Hide file tree
Showing 52 changed files with 388 additions and 29 deletions.
10 changes: 9 additions & 1 deletion src/server/accessibility/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ const accessibilityHandler = (request, h, content = english) => {
// Destructure necessary data from the imported 'content' object
const {
footer: {
accessibility: { paragraphs, pageTitle, title, headings, heading }
accessibility: {
paragraphs,
pageTitle,
title,
headings,
heading,
description
}
},
cookieBanner,
phaseBanner,
Expand All @@ -25,6 +32,7 @@ const accessibilityHandler = (request, h, content = english) => {
// Render the accessibility page with the necessary data
return h.view('accessibility/index', {
pageTitle,
description,
title,
heading,
headings,
Expand Down
10 changes: 9 additions & 1 deletion src/server/accessibility/cy/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ const accessibilityHandler = (request, h, content = welsh) => {
// Destructure necessary data from the imported 'content' object
const {
footer: {
accessibility: { pageTitle, title, heading, headings, paragraphs }
accessibility: {
pageTitle,
title,
heading,
headings,
paragraphs,
description
}
},
cookieBanner,
phaseBanner,
Expand All @@ -32,6 +39,7 @@ const accessibilityHandler = (request, h, content = welsh) => {
// Render the accessibility page with the necessary data
return h.view('accessibility/index', {
pageTitle,
description,
title,
heading,
headings,
Expand Down
1 change: 1 addition & 0 deletions src/server/check-local-air-quality/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const handleHomeRequest = (request, h, content = english) => {

return h.view('home/index', {
pageTitle: home.pageTitle,
description: home.description,
heading: home.heading,
page: home.page,
paragraphs: home.paragraphs,
Expand Down
1 change: 1 addition & 0 deletions src/server/check-local-air-quality/controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('Home Controller', () => {
expect(result).toBe('view rendered')
expect(mockH.view).toHaveBeenCalledWith('home/index', {
pageTitle: mockContent.home.pageTitle,
description: mockContent.home.description,
heading: mockContent.home.heading,
page: mockContent.home.page,
paragraphs: mockContent.home.paragraphs,
Expand Down
1 change: 1 addition & 0 deletions src/server/check-local-air-quality/cy/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const handleHomeRequest = (request, h, content = welsh) => {
// Render the home page with the necessary data
return h.view('home/index', {
pageTitle: home.pageTitle,
description: home.description,
heading: home.heading,
page: home.page,
paragraphs: home.paragraphs,
Expand Down
1 change: 1 addition & 0 deletions src/server/check-local-air-quality/cy/controller.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/server/common/templates/layouts/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
{% from "footer/macro.njk" import govukFooterWelsh %}
{% from "tabs/macro.njk" import govukTabs %}

{% set metaTitle = (pageTitle or 'Check air quality') %}
{% set metaDescription = description | default('Check air quality in your local area and the air pollution forecast for the next 5 days. Also, get health advice to reduce your exposure to pollutants.') %}
{%if lang%}
{%set htmlLang = lang %}
{% block bodyStart %}
{% include "cookie-banner.njk" %}
Expand All @@ -34,6 +37,11 @@
{% endblock %}

{% block head %}
<meta property="og:type" content="website" />
<meta property="og:url" content="https://check-air-quality.service.gov.uk/">
<meta property="og:title" content="{{metaTitle}}" />
<meta property="og:description" content="{{metaDescription}}" />
<meta name="description" content="{{metaDescription}}" />
<link href="{{ getAssetPath('application.css') }}" rel="stylesheet">
{% endblock %}

Expand Down
4 changes: 3 additions & 1 deletion src/server/cookies/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const cookiesHandler = (request, h, content = english) => {
heading,
table1,
table2,
paragraphs
paragraphs,
description
}
},
cookieBanner,
Expand All @@ -39,6 +40,7 @@ const cookiesHandler = (request, h, content = english) => {
// Render the cookies page with the necessary data
return h.view('cookies/index', {
pageTitle,
description,
title,
heading,
headings,
Expand Down
2 changes: 2 additions & 0 deletions src/server/cookies/controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('Cookies Handler', () => {
expect(result).toBe('view rendered')
expect(mockH.view).toHaveBeenCalledWith('cookies/index', {
pageTitle: mockContent.footer.cookies.pageTitle,
description: mockContent.footer.cookies.description,
title: mockContent.footer.cookies.title,
heading: mockContent.footer.cookies.heading,
headings: mockContent.footer.cookies.headings,
Expand All @@ -52,6 +53,7 @@ describe('Cookies Handler', () => {
expect(result).toBe('view rendered')
expect(mockH.view).toHaveBeenCalledWith('cookies/index', {
pageTitle: mockContent.footer.cookies.pageTitle,
description: mockContent.footer.cookies.description,
title: mockContent.footer.cookies.title,
heading: mockContent.footer.cookies.heading,
headings: mockContent.footer.cookies.headings,
Expand Down
4 changes: 3 additions & 1 deletion src/server/cookies/cy/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const cookiesHandler = (request, h, content = welsh) => {
headings,
table1,
table2,
paragraphs
paragraphs,
description
}
},
cookieBanner,
Expand All @@ -39,6 +40,7 @@ const cookiesHandler = (request, h, content = welsh) => {
// Render the cookies page with the necessary data
return h.view('cookies/index', {
pageTitle,
description,
title,
heading,
headings,
Expand Down
2 changes: 2 additions & 0 deletions src/server/cookies/cy/controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('Cookies Handler', () => {
expect(result).toBe('view rendered')
expect(mockH.view).toHaveBeenCalledWith('cookies/index', {
pageTitle: mockContent.footer.cookies.pageTitle,
description: mockContent.footer.cookies.description,
title: mockContent.footer.cookies.title,
heading: mockContent.footer.cookies.heading,
headings: mockContent.footer.cookies.headings,
Expand All @@ -52,6 +53,7 @@ describe('Cookies Handler', () => {
expect(result).toBe('view rendered')
expect(mockH.view).toHaveBeenCalledWith('cookies/index', {
pageTitle: mockContent.footer.cookies.pageTitle,
description: mockContent.footer.cookies.description,
title: mockContent.footer.cookies.title,
heading: mockContent.footer.cookies.heading,
headings: mockContent.footer.cookies.headings,
Expand Down
43 changes: 32 additions & 11 deletions src/server/data/cy/cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ export const welsh = {
paragraphs: {
a: 'Defnyddiwch y gwasanaeth yma:',
b: 'i wirio ansawdd yr aer mewn ardal leol',
c: 'i ddod o hyd i wybodaeth am lygryddion aer'
c: 'i ddod o hyd i wybodaeth am lygryddion aer',
d: 'dod o hyd i wybodaeth ac arweiniad iechyd'
},
button: 'Dechrau nawr'
button: 'Dechrau nawr',
description:
'Gwiriwch ansawdd aer eich ardal leol a’r rhagolygon llygredd aer am y 5 diwrnod nesaf. Hefyd, mynnwch gyngor iechyd i leihau’ch amlygiad i lygryddion.'
},
searchLocation: {
pageTitle: 'Ble hoffech chi wirio? - Gwirio ansawdd aer - GOV.UK',
Expand Down Expand Up @@ -54,7 +57,9 @@ export const welsh = {
}
}
}
}
},
description:
'Chwiliwch am ansawdd aer unrhyw ardal leol. Hefyd, mynnwch gyngor iechyd am lygredd aer a sut i leihau’ch amlygiad iddo.'
},
notFoundLocation: {
heading: 'Gwirio ansawdd aer ',
Expand Down Expand Up @@ -220,7 +225,9 @@ export const welsh = {
j: 'materion y system nerfol',
k: 'canser',
l: 'materion y galon'
}
},
description:
'Dysgwch sut mae osôn yn cael ei ffurfio. Hefyd, dysgwch am effeithiau iechyd byrdymor a hirdymor amlygiad i osôn.'
},
nitrogenDioxide: {
title: 'Nitrogen deuocsid (NO₂)',
Expand All @@ -245,7 +252,9 @@ export const welsh = {
l: 'Gall amlygiad hirdymor i nitrogen deuocsid achosi:',
m: 'mwy o risg o heintiau anadlol',
n: 'gwaeth gweithrediad yr ysgyfaint mewn plant'
}
},
description:
'Dysgwch sut mae nitrogen deuocsid yn cael ei gynhyrchu. Hefyd, dysgwch am effeithiau iechyd byrdymor a hirdymor amlygiad i nitrogen deuocsid.'
},
sulphurDioxide: {
title: 'Sylffwr deuocsid (SO₂)',
Expand All @@ -270,7 +279,9 @@ export const welsh = {
l: 'llai o weithrediad yn yr ysgyfaint',
m: 'newid synnwyr arogli',
n: 'mwy o heintiau’r anadl'
}
},
description:
'Dysgwch sut mae sylffwr deuocsid yn cael ei gynhyrchu. Hefyd, dysgwch am effeithiau iechyd byrdymor a thymor hir sylffwr deuocsid.'
},
particulateMatter10: {
title: 'Mater gronynnol (PM10)',
Expand Down Expand Up @@ -301,7 +312,9 @@ export const welsh = {
r: 'methiant y galon',
s: 'canser',
t: 'clefyd rhwystrol cronig yr ysgyfaint (COPD)'
}
},
description:
'Mae PM10 yn fater gronynnol (PM) wedi’i wneud o ronynnau bach o solidau neu hylifau yn yr awyr. Dysgwch am ffynonellau PM10 a sut y gall amlygiad iddo effeithio ar iechyd.'
},
particulateMatter25: {
title: 'Mater gronynnol (PM2.5)',
Expand Down Expand Up @@ -333,7 +346,9 @@ export const welsh = {
s: 'diabetes',
t: 'clefyd Alzheimer a chlefyd Parkinson',
u: 'iechyd ysgyfaint gwael mewn plant'
}
},
description:
'Mae PM2.5 yn fater gronynnol (PM) wedi’i wneud o ronynnau bach o solidau neu hylifau yn yr awyr. Dysgwch am ffynonellau PM2.5 a sut y gall amlygiad iddo effeithio ar iechyd.'
}
},
dailySummaryTexts: {
Expand Down Expand Up @@ -416,7 +431,9 @@ export const welsh = {
a22: 'yn esbonio rhagor am eich hawliau dros eich data personol.',
a23: 'Gallwch ',
a24: 'optio i mewn ac allan o dderbyn cwcis.'
}
},
description:
'Mae Gwirio ansawdd aer yn cymryd eich preifatrwydd o ddifrif. Darllenwch y Polisi Preifatrwydd yma i ddysgu sut rydyn ni’n trin eich data personol.'
},
cookies: {
title: 'Cwcis',
Expand Down Expand Up @@ -481,7 +498,9 @@ export const welsh = {
ga3: '_gat_UA-[G-8CMZBTDQBC]',
ga4: 'a',
ga5: 'ond yn weithredol os byddwch yn derbyn y cwcis. Fodd bynnag, os nad ydych yn derbyn cwcis, efallai y byddant yn dal i ymddangos yn eich sesiwn cwci, ond ni fyddant yn weithredol.'
}
},
description:
'Mae Gwirio ansawdd aer yn defnyddio cwcis. Drwy ddefnyddio’r gwasanaeth yma rydych chi’n cytuno i’n defnydd o gwcis.'
},
accessibility: {
title: 'Datganiad Hygyrchedd',
Expand All @@ -503,7 +522,9 @@ export const welsh = {
g: 'Os byddwch yn sylwi ar unrhyw fethiannau cydymffurfiaeth neu os oes angen ichi ofyn am wybodaeth a chynnwys sydd heb gael eu darparu yn y ddogfen yma, anfonwch neges ebost at',
h: 'Y Comisiwn Cydraddoldeb a Hawliau Dynol (EHRC) sy’n gyfrifol am orfodi Rheoliadau Hygyrchedd Cyrff y Sector Cyhoeddus (Gwefannau a Chymwysiadau Symudol) (Rhif 2) 2018 (y ’rheoliadau hygyrchedd’). ',
i: 'Os nad ydych chi’n fodlon ar y ffordd rydyn ni’n ymateb i’ch cwyn, cysylltwch â’r Gwasanaeth Cynghori a Chymorth Cydraddoldeb (EASS).'
}
},
description:
'Mae Gwirio ansawdd aer wedi ymrwymo i wella hygyrchedd i bob defnyddiwr gwe, ffonau symudol ac ap, dan arweiniad y Canllawiau diweddaraf ar Hygyrchedd Cynnwys y We (WCAG).'
}
}
}
Expand Down
43 changes: 32 additions & 11 deletions src/server/data/en/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ export const english = {
paragraphs: {
a: 'Use this service to:',
b: 'check air quality in a local area',
c: 'find information on air pollutants'
c: 'find information on air pollutants',
d: 'find health information and guidance'
},
button: 'Start now'
button: 'Start now',
description:
'Check air quality in your local area and the air pollution forecast for the next 5 days. Also, get health advice to reduce your exposure to pollutants'
},
searchLocation: {
pageTitle: 'Where do you want to check? - Check air quality - GOV.UK',
Expand Down Expand Up @@ -61,7 +64,9 @@ export const english = {
}
}
}
}
},
description:
'Search the air quality in any local area. Also, get health advice about air pollution and how to reduce your exposure.'
},
notFoundLocation: {
heading: 'Check air quality',
Expand Down Expand Up @@ -242,7 +247,9 @@ export const english = {
j: 'nervous system issues',
k: 'cancer',
l: 'heart issues'
}
},
description:
'Learn how ozone is formed. Also, learn the short term and long term health effects of ozone exposure.'
},
nitrogenDioxide: {
title: 'Nitrogen dioxide (NO₂)',
Expand All @@ -267,7 +274,9 @@ export const english = {
l: 'Long term exposure to nitrogen dioxide can cause:',
m: 'an increase risk of respiratory infections',
n: 'poorer lung function in children'
}
},
description:
'Learn how nitrogen dioxide is produced. Also, learn the short term and long term health effects of nitrogen dioxide exposure.'
},
sulphurDioxide: {
title: 'Sulphur dioxide (SO₂)',
Expand All @@ -292,7 +301,9 @@ export const english = {
l: 'reduced lung function',
m: 'altered sense of smell',
n: 'increased respiratory infections'
}
},
description:
'Learn how sulphur dioxide is produced. Also, learn the short term and long term health effects of nitrogen sulphur dioxide'
},
particulateMatter10: {
title: 'Particulate matter (PM10)',
Expand Down Expand Up @@ -323,7 +334,9 @@ export const english = {
r: 'heart failure',
s: 'cancer',
t: 'chronic obstructive pulmonary disease (COPD)'
}
},
description:
'PM10 is a particulate matter (PM) made of small particles of solids or liquids in the air. Learn the sources of PM10 and how exposure can impact health.'
},
particulateMatter25: {
title: 'Particulate matter (PM2.5)',
Expand Down Expand Up @@ -355,7 +368,9 @@ export const english = {
s: 'diabetes',
t: 'Alzheimer’s and Parkinson’s disease',
u: 'poor lung health in children'
}
},
description:
'PM2.5 is a particulate matter (PM) made of small particles of solids or liquids in the air. Learn the sources of PM2.5 and how exposure can impact health.'
}
},
dailySummaryTexts: {
Expand Down Expand Up @@ -437,7 +452,9 @@ export const english = {
a22: 'explains more about your rights over your personal data.',
a23: 'You can',
a24: 'opt in and out of cookie acceptance.'
}
},
description:
'Check air quality takes your privacy seriously. Read this Privacy Policy to learn how we treat your personal data.'
},
cookies: {
title: 'Cookies',
Expand Down Expand Up @@ -501,7 +518,9 @@ export const english = {
ga3: '_gat_UA-[G-8CMZBTDQBC]',
ga4: 'and',
ga5: 'will only be active if you accept the cookies. However, if you do not accept cookies, they may still appear in your cookie session, but they will not be active.'
}
},
description:
'Check air quality uses cookies. By using this service you agree to our use of cookies.'
},
accessibility: {
title: 'Accessibility Statement',
Expand All @@ -522,7 +541,9 @@ export const english = {
g: 'If you notice any compliance failures or need to request information and content that is not provided in this document, please email',
h: 'The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’).',
i: 'If you’re not happy with how we respond to your complaint, contact the Equality Advisory and Support Service (EASS).'
}
},
description:
'Check air quality is committed to improving accessibility for all web, mobile, and app users, guided by the latest Web Content Accessibility Guidelines (WCAG).'
}
}
}
Expand Down
Loading

0 comments on commit c2af892

Please sign in to comment.