diff --git a/.eleventy.js b/.eleventy.js
index 15bbf1be4..ab6c902f0 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -59,6 +59,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({"lib/_netlify": "/"});
eleventyConfig.addPassthroughCopy({"node_modules/nhsuk-frontend/packages/assets": "/nhsuk-frontend/assets"});
eleventyConfig.addPassthroughCopy({"node_modules/nhsuk-frontend/dist/*.js": "/javascripts"});
+ eleventyConfig.addPassthroughCopy({"node_modules/@nhsbsa/cookie-consent-component/dist/*.js": "/javascripts"});
eleventyConfig.addPassthroughCopy("src/**/*.jpg");
eleventyConfig.addPassthroughCopy("src/**/*.jpeg");
eleventyConfig.addPassthroughCopy("src/**/*.png");
diff --git a/lib/_layouts/_base.njk b/lib/_layouts/_base.njk
index cbb4685d5..938920da1 100644
--- a/lib/_layouts/_base.njk
+++ b/lib/_layouts/_base.njk
@@ -3,6 +3,7 @@
{% from "hero/macro.njk" import hero as appHero %}
{% from "appFooter/macro.njk" import appFooter as oglFooter %}
{% from 'back-link/macro.njk' import backLink %}
+{% from 'cookie-banner/macro.njk' import cookieBanner %}
{% set htmlClasses = 'no-js' %}
{% set homeUrl = '/' | url %}
{% set containerClasses = containerClasses | default("app-width-container") %}
@@ -27,6 +28,18 @@
{% endblock %}
+ {% block googleAnalytics %}
+
+
+
+ {% endblock %}
+
@@ -74,6 +87,25 @@
+ {% block cookieBanner %}
+ {{ cookieBanner({
+ policyUrl: "/cookie-policy/" | url,
+ classes: "app-width-container",
+ linkText: "read more about our cookies",
+ cookieBannerHeading: "NHSBSA Digital, Data and Technology Playbook",
+ cookieBannerContent: [
+ "We've put some small files called cookies on your device to make our site work.",
+ "We'd also like to use analytics cookies. These send anonymous information about how our site is used to a service called Google Analytics. We use this information to improve our site.",
+ "Let us know if this is OK. We'll use a cookie to save your choice across all our digital services for the next 3 calendar months. You can {{cookiePolicyHref}} before you choose."
+ ],
+ okButtonText: "I'm OK with analytics cookies",
+ notOkButtonText: "Do not use analytics cookies",
+ cookieVersion: 1,
+ successLinkText: "our cookies page",
+ successBannerMessage: "You can change your cookie settings at any time using {{bannerSuccessHref}}."
+ }) }}
+ {% endblock %}
+
{% block bodyStart %}{% endblock %}
{% block skipLink %}
@@ -107,6 +139,7 @@
{% block bodyEndScripts %}
+
{% block pageScripts %}{% endblock %}
{% endblock %}
diff --git a/lib/_libraries/nunjucks.js b/lib/_libraries/nunjucks.js
index 390085199..88f05f569 100644
--- a/lib/_libraries/nunjucks.js
+++ b/lib/_libraries/nunjucks.js
@@ -9,6 +9,7 @@ module.exports = (() => {
'lib/_layouts',
'lib/_components',
'node_modules/nhsuk-frontend/packages/components',
+ 'node_modules/@nhsbsa/cookie-consent-component/component',
],
{
watch: process.env.NODE_ENV === 'development',
diff --git a/lib/_stylesheets/app/_cookie-banner.scss b/lib/_stylesheets/app/_cookie-banner.scss
new file mode 100644
index 000000000..4ee8f387a
--- /dev/null
+++ b/lib/_stylesheets/app/_cookie-banner.scss
@@ -0,0 +1,12 @@
+/* ==========================================================================
+ #COOKIE BANNER
+ ========================================================================== */
+
+// Container width variable
+#nhsuk-cookie-banner .app-width-container {
+ max-width: 1100px;
+
+ @media (min-width: 767px) and (max-width: 1164px) {
+ margin: 0 nhsuk-spacing(5);
+ }
+}
diff --git a/lib/_stylesheets/app/_imports.scss b/lib/_stylesheets/app/_imports.scss
index f63e3d795..2980ff97b 100644
--- a/lib/_stylesheets/app/_imports.scss
+++ b/lib/_stylesheets/app/_imports.scss
@@ -7,6 +7,7 @@
@import 'colour-swatch';
@import 'contact-panel';
@import 'container';
+@import 'cookie-banner';
@import 'example-callout';
@import 'featured-list';
@import 'footer';
diff --git a/lib/_stylesheets/application.scss b/lib/_stylesheets/application.scss
index 76b91061b..4f3d1dedf 100644
--- a/lib/_stylesheets/application.scss
+++ b/lib/_stylesheets/application.scss
@@ -1,3 +1,4 @@
@import "node_modules/nhsuk-frontend/packages/nhsuk";
+@import "node_modules/@nhsbsa/cookie-consent-component/dist/cookie-banner";
@import './app/imports';
@import './custom/imports';
diff --git a/package-lock.json b/package-lock.json
index fabacdd8a..6b49058e4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,6 +8,9 @@
"name": "nhsbsa-digital-playbook",
"version": "1.0.0",
"license": "Apache-2.0",
+ "dependencies": {
+ "@nhsbsa/cookie-consent-component": "0.0.6"
+ },
"devDependencies": {
"@11ty/eleventy": "^2.0.0",
"@11ty/eleventy-navigation": "^0.3.2",
@@ -1314,6 +1317,30 @@
"@jridgewell/sourcemap-codec": "1.4.14"
}
},
+ "node_modules/@nhsbsa/cookie-consent-component": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/@nhsbsa/cookie-consent-component/-/cookie-consent-component-0.0.6.tgz",
+ "integrity": "sha512-eAJ6JLTB8sZO0H0rB88LlwxYMUE6DKwWPr6UcDbrH/K/BQ93LpJhxFbEe+valDjPyoz5vEpHG9JxzTIHPPE0Xw==",
+ "dependencies": {
+ "@nhsbsa/cookie-consent-component": "^0.0.4",
+ "nhsuk-frontend": "^7.0.0",
+ "nunjucks": "^3.2.4"
+ }
+ },
+ "node_modules/@nhsbsa/cookie-consent-component/node_modules/@nhsbsa/cookie-consent-component": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/@nhsbsa/cookie-consent-component/-/cookie-consent-component-0.0.4.tgz",
+ "integrity": "sha512-8VgePyftnnonSTZ9SKSYFu7C/ySYTEqIL8Ay/s/Ia9mC+8W0qshl/gWsj90sDAjtWmqD5fkzo+lIhBqxCj9oNg==",
+ "dependencies": {
+ "nhsuk-frontend": "^7.0.0",
+ "nunjucks": "^3.2.4"
+ }
+ },
+ "node_modules/@nhsbsa/cookie-consent-component/node_modules/nhsuk-frontend": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/nhsuk-frontend/-/nhsuk-frontend-7.1.0.tgz",
+ "integrity": "sha512-V3GDwwAWgBOZHKlh8kdpq8hiOh/mbD95MQrgI1qych2yRFeMXdOg1439VkOmmdKBJT5zuy9BA//33aU5NzYfjw=="
+ },
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -1561,8 +1588,7 @@
"node_modules/a-sync-waterfall": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz",
- "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==",
- "dev": true
+ "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA=="
},
"node_modules/acorn": {
"version": "7.4.1",
@@ -1650,7 +1676,7 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
@@ -1704,8 +1730,7 @@
"node_modules/asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
- "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",
- "dev": true
+ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="
},
"node_modules/assert-never": {
"version": "1.2.1",
@@ -1871,7 +1896,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
- "dev": true,
+ "devOptional": true,
"engines": {
"node": ">=8"
}
@@ -1896,7 +1921,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"fill-range": "^7.0.1"
},
@@ -2070,7 +2095,7 @@
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
- "dev": true,
+ "devOptional": true,
"funding": [
{
"type": "individual",
@@ -2166,7 +2191,6 @@
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
- "dev": true,
"engines": {
"node": ">= 6"
}
@@ -2994,7 +3018,7 @@
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"to-regex-range": "^5.0.1"
},
@@ -3205,7 +3229,7 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"is-glob": "^4.0.1"
},
@@ -3510,7 +3534,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"binary-extensions": "^2.0.0"
},
@@ -3563,7 +3587,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true,
+ "devOptional": true,
"engines": {
"node": ">=0.10.0"
}
@@ -3590,7 +3614,7 @@
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"is-extglob": "^2.1.1"
},
@@ -3608,7 +3632,7 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true,
+ "devOptional": true,
"engines": {
"node": ">=0.12.0"
}
@@ -5152,7 +5176,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "dev": true,
+ "devOptional": true,
"engines": {
"node": ">=0.10.0"
}
@@ -5185,7 +5209,6 @@
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz",
"integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==",
- "dev": true,
"dependencies": {
"a-sync-waterfall": "^1.0.0",
"asap": "^2.0.3",
@@ -5438,7 +5461,7 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
+ "devOptional": true,
"engines": {
"node": ">=8.6"
},
@@ -5901,7 +5924,7 @@
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"picomatch": "^2.2.1"
},
@@ -6391,7 +6414,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
+ "devOptional": true,
"dependencies": {
"is-number": "^7.0.0"
},
@@ -7682,6 +7705,32 @@
"@jridgewell/sourcemap-codec": "1.4.14"
}
},
+ "@nhsbsa/cookie-consent-component": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/@nhsbsa/cookie-consent-component/-/cookie-consent-component-0.0.6.tgz",
+ "integrity": "sha512-eAJ6JLTB8sZO0H0rB88LlwxYMUE6DKwWPr6UcDbrH/K/BQ93LpJhxFbEe+valDjPyoz5vEpHG9JxzTIHPPE0Xw==",
+ "requires": {
+ "@nhsbsa/cookie-consent-component": "^0.0.4",
+ "nhsuk-frontend": "^7.0.0",
+ "nunjucks": "^3.2.4"
+ },
+ "dependencies": {
+ "@nhsbsa/cookie-consent-component": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/@nhsbsa/cookie-consent-component/-/cookie-consent-component-0.0.4.tgz",
+ "integrity": "sha512-8VgePyftnnonSTZ9SKSYFu7C/ySYTEqIL8Ay/s/Ia9mC+8W0qshl/gWsj90sDAjtWmqD5fkzo+lIhBqxCj9oNg==",
+ "requires": {
+ "nhsuk-frontend": "^7.0.0",
+ "nunjucks": "^3.2.4"
+ }
+ },
+ "nhsuk-frontend": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/nhsuk-frontend/-/nhsuk-frontend-7.1.0.tgz",
+ "integrity": "sha512-V3GDwwAWgBOZHKlh8kdpq8hiOh/mbD95MQrgI1qych2yRFeMXdOg1439VkOmmdKBJT5zuy9BA//33aU5NzYfjw=="
+ }
+ }
+ },
"@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -7907,8 +7956,7 @@
"a-sync-waterfall": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz",
- "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==",
- "dev": true
+ "integrity": "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA=="
},
"acorn": {
"version": "7.4.1",
@@ -7969,7 +8017,7 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
- "dev": true,
+ "devOptional": true,
"requires": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
@@ -8008,8 +8056,7 @@
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
- "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==",
- "dev": true
+ "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA=="
},
"assert-never": {
"version": "1.2.1",
@@ -8139,7 +8186,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
- "dev": true
+ "devOptional": true
},
"boolbase": {
"version": "1.0.0",
@@ -8161,7 +8208,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
- "dev": true,
+ "devOptional": true,
"requires": {
"fill-range": "^7.0.1"
}
@@ -8279,7 +8326,7 @@
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
- "dev": true,
+ "devOptional": true,
"requires": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
@@ -8344,8 +8391,7 @@
"commander": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
- "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==",
- "dev": true
+ "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg=="
},
"concat-map": {
"version": "0.0.1",
@@ -8956,7 +9002,7 @@
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
- "dev": true,
+ "devOptional": true,
"requires": {
"to-regex-range": "^5.0.1"
}
@@ -9116,7 +9162,7 @@
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
+ "devOptional": true,
"requires": {
"is-glob": "^4.0.1"
}
@@ -9339,7 +9385,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
- "dev": true,
+ "devOptional": true,
"requires": {
"binary-extensions": "^2.0.0"
}
@@ -9379,7 +9425,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true
+ "devOptional": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
@@ -9397,7 +9443,7 @@
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
+ "devOptional": true,
"requires": {
"is-extglob": "^2.1.1"
}
@@ -9412,7 +9458,7 @@
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true
+ "devOptional": true
},
"is-path-inside": {
"version": "3.0.3",
@@ -10621,7 +10667,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "dev": true
+ "devOptional": true
},
"npm-run-path": {
"version": "4.0.1",
@@ -10645,7 +10691,6 @@
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/nunjucks/-/nunjucks-3.2.4.tgz",
"integrity": "sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ==",
- "dev": true,
"requires": {
"a-sync-waterfall": "^1.0.0",
"asap": "^2.0.3",
@@ -10826,7 +10871,7 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true
+ "devOptional": true
},
"pify": {
"version": "2.3.0",
@@ -11192,7 +11237,7 @@
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
- "dev": true,
+ "devOptional": true,
"requires": {
"picomatch": "^2.2.1"
}
@@ -11552,7 +11597,7 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
+ "devOptional": true,
"requires": {
"is-number": "^7.0.0"
}
diff --git a/package.json b/package.json
index f15eb2cca..c4bd792bc 100644
--- a/package.json
+++ b/package.json
@@ -51,5 +51,8 @@
"nhsuk-frontend": "^6.1.2",
"regexpp": "^3.2.0",
"text-table": "^0.2.0"
+ },
+ "dependencies": {
+ "@nhsbsa/cookie-consent-component": "0.0.6"
}
}
diff --git a/src/_data/siteMeta.yaml b/src/_data/siteMeta.yaml
index 892fa9fca..b85ecf000 100644
--- a/src/_data/siteMeta.yaml
+++ b/src/_data/siteMeta.yaml
@@ -11,5 +11,7 @@ footer:
label: "Accessibility"
- url: "https://www.nhsbsa.nhs.uk/contact-us"
label: "Contact us"
+ - url: "/cookie-policy/"
+ label: "Cookies"
- url: "https://github.com/nhsbsa/nhsbsa-digital-playbook"
label: "GitHub"
\ No newline at end of file
diff --git a/src/cookie-policy/cookies-confirmation.md b/src/cookie-policy/cookies-confirmation.md
new file mode 100644
index 000000000..d42e1e1dd
--- /dev/null
+++ b/src/cookie-policy/cookies-confirmation.md
@@ -0,0 +1,18 @@
+---
+layout: page
+title: "Your cookie settings have been saved"
+---
+{% from 'button/macro.njk' import button %}
+
+# Your cookie settings have been saved
+
+We'll save your settings for three months.
+
+We'll ask you if you're still OK with us using cookies when either:
+
+- it's been three months since you last saved your settings
+- we add any new cookies or change the cookies we use
+
+You can also [choose which cookies](/nhsbsa-digital-playbook/cookie-policy/) we use at any time.
+
+[Return to home page](/nhsbsa-digital-playbook/).
diff --git a/src/cookie-policy/cookies-settings.md b/src/cookie-policy/cookies-settings.md
new file mode 100644
index 000000000..d13013b7e
--- /dev/null
+++ b/src/cookie-policy/cookies-settings.md
@@ -0,0 +1,34 @@
+---
+layout: page
+title: "Choose which cookies we use"
+---
+
+{% from 'cookie-preferences/macro.njk' import cookiePreferences %}
+
+# Choose which cookies we use
+
+Let us know which cookies we can use. We'll use a cookie to save your settings.
+
+## Cookies that measure website use (analytics cookies)
+
+These cookies store information about how you use our website, such as the links you click on. We use them to help make our website better.
+
+::: details List of cookies that make our website work
+
+### List of cookies that measure website use
+
+| Name | Purpose | Expires |
+| ----------- | ----------- | ----------- |
+| _ga | Used by Google Analytics. Tells us how you use our services. | 2 years |
+| _ga_NQ562NM01Z| This cookie registers a unique ID that is used to generate statistical data on how the visitor uses the website. | 2 years |
+
+:::
+
+{{ cookiePreferences({
+ preferenceText: "Do you want to allow cookies to measure your website use?",
+ fieldsetClasses: "nhsuk-fieldset__legend--m",
+ radioYesText: "Use cookies to measure my website use",
+ radioNoText: "Do not use cookies to measure my website uses",
+ saveCookiePreferencesButtonText: "Save my cookie settings",
+ cookieConfirmationURL: "/nhsbsa-digital-playbook/cookie-policy/cookies-confirmation/"
+}) }}
\ No newline at end of file
diff --git a/src/cookie-policy/index.md b/src/cookie-policy/index.md
new file mode 100644
index 000000000..2df40391e
--- /dev/null
+++ b/src/cookie-policy/index.md
@@ -0,0 +1,48 @@
+---
+layout: page
+title: "Cookies on the NHSBSA Digital, Data and Technology Playbook"
+---
+
+{% from 'action-link/macro.njk' import actionLink %}
+
+# Cookies on the NHSBSA Digital, Data and Technology Playbook
+
+Cookies are files saved on your phone, tablet or computer when you visit a website.
+
+They store information about how you use the website, such as the pages you visit.
+
+Cookies are not viruses or computer programs. They are very small so do not take up much space.
+
+## How we use cookies
+
+We use cookies to:
+
+- make our website work, for example by keeping it secure
+- remember which pop-ups you've seen
+- measure how you use our website, such as which links you click on (analytics cookies)
+- help show you relevant health campaigns on social media
+
+::: details List of cookies that make our website work
+
+### Cookies needed for the website to work
+
+| Name | Purpose | Expires |
+| ----------- | ----------- | ----------- |
+| nhsuk-cookie-consent | Remembers if you used our cookies banner | 3 months |
+
+:::
+
+## Change your cookie settings
+
+Some cookies, like those used to measure how you use our website, are not needed for our website to work.
+
+These cookies can help us make our website better, but we'll only use them if you say it's OK.
+
+{{ actionLink({
+ "text": "Choose which cookies we use",
+ "href": "cookies-settings/"
+}) }}
+
+## How we use the information we collect
+
+To find out how we collect, store and use information about you or your visit, see the [NHSBSA website privacy policy (opens in a new tab)](https://www.nhsbsa.nhs.uk/our-policies/privacy).
\ No newline at end of file