@domandigital/create-site 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +26 -3
- package/dist/cli.js +138 -30
- package/package.json +2 -2
- package/templates/astro/components/CookieBanner.astro +42 -0
- package/templates/astro/pages/accessibility.astro +65 -0
- package/templates/astro/pages/cookies.astro +72 -0
- package/templates/astro/pages/privacy.astro +90 -0
- package/templates/astro/pages/terms.astro +76 -0
- package/templates/next/app/accessibility/page.tsx +65 -0
- package/templates/next/app/cookies/page.tsx +74 -0
- package/templates/next/app/privacy/page.tsx +96 -0
- package/templates/next/app/terms/page.tsx +79 -0
- package/templates/next/components/CookieBanner.tsx +55 -0
- package/templates/shared/lib/consent.ts +45 -0
- package/templates/shared/lib/graph/site-adapter.ts +36 -0
- package/templates/shared/lib/legal.ts +33 -0
- package/templates/shared/tests/house.test.ts +16 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The privacy policy, from the UK GDPR baseline in dd-base
|
|
3
|
+
// (Doman-Digital/dd-library), reading every fact from site.facts.ts. A fact
|
|
4
|
+
// that is null is left out, never filled with a placeholder; launch:check
|
|
5
|
+
// fails until the ones every site needs are set. A whole document, because a
|
|
6
|
+
// fresh Astro site may have no layout yet: move it into yours.
|
|
7
|
+
// Written by @domandigital/create-site.
|
|
8
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
9
|
+
import JsonLd from "~site/components/JsonLd.astro";
|
|
10
|
+
import { facts } from "~site/facts";
|
|
11
|
+
import { ICO_COMPLAINTS, identity, legal, privacyEmail } from "~site/legal";
|
|
12
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
13
|
+
import { policy } from "~site/routes";
|
|
14
|
+
|
|
15
|
+
const title = `Privacy policy: ${facts.tradingName}`;
|
|
16
|
+
const description = `How ${facts.tradingName} collects, uses and protects personal data under the UK GDPR.`;
|
|
17
|
+
const indexable = isRouteIndexable(policy, "/privacy");
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<html lang="en-GB">
|
|
21
|
+
<head>
|
|
22
|
+
<meta charset="utf-8" />
|
|
23
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
24
|
+
<title>{title}</title>
|
|
25
|
+
<meta name="description" content={description} />
|
|
26
|
+
{!indexable && <meta name="robots" content="noindex" />}
|
|
27
|
+
<JsonLd graph={buildPageGraph({ path: "/privacy", name: title, description })} />
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<main>
|
|
31
|
+
<h1>Privacy policy</h1>
|
|
32
|
+
{legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
|
|
33
|
+
|
|
34
|
+
<section>
|
|
35
|
+
<h2>Who we are</h2>
|
|
36
|
+
<p>{identity()} is responsible for the personal data collected through this website.</p>
|
|
37
|
+
{legal.icoNumber && <p>We are registered with the Information Commissioner's Office, number {legal.icoNumber}.</p>}
|
|
38
|
+
</section>
|
|
39
|
+
|
|
40
|
+
<section>
|
|
41
|
+
<h2>What we collect</h2>
|
|
42
|
+
<p>
|
|
43
|
+
When you contact us we keep what you send: your name, how to reach you and your message. When you use the site,
|
|
44
|
+
the server records technical details such as your IP address and browser to keep it running and secure. With
|
|
45
|
+
your permission, and only then, we also measure how the site is used.
|
|
46
|
+
</p>
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
<section>
|
|
50
|
+
<h2>Why we are allowed to</h2>
|
|
51
|
+
<ul>
|
|
52
|
+
<li>Answering you and doing the work you ask for: taking steps towards a contract, or a contract, Article 6(1)(b).</li>
|
|
53
|
+
<li>Measurement cookies: your consent, Article 6(1)(a). They are off until you accept them.</li>
|
|
54
|
+
<li>Keeping the site running and secure: our legitimate interests, Article 6(1)(f).</li>
|
|
55
|
+
</ul>
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
{legal.processors.length > 0 && (
|
|
59
|
+
<section>
|
|
60
|
+
<h2>Who we share it with</h2>
|
|
61
|
+
<p>These companies handle personal data for us, under written contracts:</p>
|
|
62
|
+
<ul>
|
|
63
|
+
{legal.processors.map((p) => <li>{p.name}: {p.purpose}</li>)}
|
|
64
|
+
</ul>
|
|
65
|
+
<p>We do not sell personal data.</p>
|
|
66
|
+
</section>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
{legal.retention && (
|
|
70
|
+
<section>
|
|
71
|
+
<h2>How long we keep it</h2>
|
|
72
|
+
<p>{legal.retention}</p>
|
|
73
|
+
</section>
|
|
74
|
+
)}
|
|
75
|
+
|
|
76
|
+
<section>
|
|
77
|
+
<h2>Your rights</h2>
|
|
78
|
+
<p>
|
|
79
|
+
You can ask to see, correct, delete or move your personal data, ask us to stop or limit using it, and object to
|
|
80
|
+
how we use it. Where we rely on your consent you can withdraw it at any time.
|
|
81
|
+
{privacyEmail && <>Write to <a href={`mailto:${privacyEmail}`}>{privacyEmail}</a>.</>}
|
|
82
|
+
</p>
|
|
83
|
+
<p>
|
|
84
|
+
If you are unhappy with our answer you can complain to the Information Commissioner's Office:
|
|
85
|
+
<a href={ICO_COMPLAINTS}>ico.org.uk/make-a-complaint</a>.
|
|
86
|
+
</p>
|
|
87
|
+
</section>
|
|
88
|
+
</main>
|
|
89
|
+
</body>
|
|
90
|
+
</html>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
// The website terms, from dd-base (Doman-Digital/dd-library). The governing
|
|
3
|
+
// law is a fact in site.facts.ts, not assumed: a Scottish business is under
|
|
4
|
+
// Scots law. A whole document: move it into your layout.
|
|
5
|
+
// Written by @domandigital/create-site.
|
|
6
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
7
|
+
import JsonLd from "~site/components/JsonLd.astro";
|
|
8
|
+
import { facts } from "~site/facts";
|
|
9
|
+
import { identity, legal } from "~site/legal";
|
|
10
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
11
|
+
import { policy } from "~site/routes";
|
|
12
|
+
|
|
13
|
+
const title = `Website terms: ${facts.tradingName}`;
|
|
14
|
+
const description = `The terms for using ${new URL(facts.url).hostname}.`;
|
|
15
|
+
const indexable = isRouteIndexable(policy, "/terms");
|
|
16
|
+
const host = new URL(facts.url).hostname;
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<html lang="en-GB">
|
|
20
|
+
<head>
|
|
21
|
+
<meta charset="utf-8" />
|
|
22
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
23
|
+
<title>{title}</title>
|
|
24
|
+
<meta name="description" content={description} />
|
|
25
|
+
{!indexable && <meta name="robots" content="noindex" />}
|
|
26
|
+
<JsonLd graph={buildPageGraph({ path: "/terms", name: title, description })} />
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<main>
|
|
30
|
+
<h1>Website terms</h1>
|
|
31
|
+
{legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
|
|
32
|
+
|
|
33
|
+
<section>
|
|
34
|
+
<h2>About these terms</h2>
|
|
35
|
+
<p>These terms cover your use of {host}, run by {identity()}. By using the site you accept them.</p>
|
|
36
|
+
</section>
|
|
37
|
+
|
|
38
|
+
<section>
|
|
39
|
+
<h2>Using the site</h2>
|
|
40
|
+
<p>Use the site lawfully. Do not try to break into it, slow it down or spread anything harmful through it.</p>
|
|
41
|
+
</section>
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<h2>Who owns the content</h2>
|
|
45
|
+
<p>
|
|
46
|
+
The content belongs to {facts.legalName} or is used with permission. You may view it and save a copy for your
|
|
47
|
+
own use. Ask us before publishing it anywhere else.
|
|
48
|
+
</p>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<section>
|
|
52
|
+
<h2>Availability and accuracy</h2>
|
|
53
|
+
<p>
|
|
54
|
+
We work to keep the site available and correct, but cannot promise it always will be. The information here is
|
|
55
|
+
general and is not professional advice for your situation.
|
|
56
|
+
</p>
|
|
57
|
+
</section>
|
|
58
|
+
|
|
59
|
+
<section>
|
|
60
|
+
<h2>Liability</h2>
|
|
61
|
+
<p>
|
|
62
|
+
Nothing in these terms limits our liability for death or personal injury caused by our negligence, for fraud, or
|
|
63
|
+
for anything else the law does not allow us to limit. Otherwise we are not liable for indirect or consequential
|
|
64
|
+
loss from using the site.
|
|
65
|
+
</p>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
{legal.governingLaw && (
|
|
69
|
+
<section>
|
|
70
|
+
<h2>The law that applies</h2>
|
|
71
|
+
<p>These terms are governed by the law of {legal.governingLaw}, and its courts deal with any dispute about them.</p>
|
|
72
|
+
</section>
|
|
73
|
+
)}
|
|
74
|
+
</main>
|
|
75
|
+
</body>
|
|
76
|
+
</html>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// The accessibility statement, from dd-base (Doman-Digital/dd-library). It
|
|
2
|
+
// states the standard the house builds to and the problems someone has
|
|
3
|
+
// actually found; it claims nothing it has not checked. Written by
|
|
4
|
+
// @domandigital/create-site.
|
|
5
|
+
|
|
6
|
+
import type { Metadata } from "next";
|
|
7
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
+
import { JsonLd } from "~site/components/JsonLd";
|
|
9
|
+
import { facts } from "~site/facts";
|
|
10
|
+
import { legal } from "~site/legal";
|
|
11
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
12
|
+
import { policy } from "~site/routes";
|
|
13
|
+
|
|
14
|
+
const TITLE = `Accessibility: ${facts.tradingName}`;
|
|
15
|
+
const DESCRIPTION = `How ${facts.tradingName} makes this website usable by everyone, and how to tell us when it is not.`;
|
|
16
|
+
|
|
17
|
+
export const metadata: Metadata = {
|
|
18
|
+
title: TITLE,
|
|
19
|
+
description: DESCRIPTION,
|
|
20
|
+
robots: { index: isRouteIndexable(policy, "/accessibility") },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default function AccessibilityPage() {
|
|
24
|
+
return (
|
|
25
|
+
<main>
|
|
26
|
+
<JsonLd graph={buildPageGraph({ path: "/accessibility", name: TITLE, description: DESCRIPTION })} />
|
|
27
|
+
<h1>Accessibility</h1>
|
|
28
|
+
{legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
|
|
29
|
+
|
|
30
|
+
<section>
|
|
31
|
+
<h2>The standard we build to</h2>
|
|
32
|
+
<p>We aim for this site to meet the Web Content Accessibility Guidelines (WCAG) 2.2 at level AA. That means:</p>
|
|
33
|
+
<ul>
|
|
34
|
+
<li>text has enough contrast against its background</li>
|
|
35
|
+
<li>everything works with a keyboard</li>
|
|
36
|
+
<li>images that carry meaning have a text alternative</li>
|
|
37
|
+
<li>movement stops when your device asks for reduced motion</li>
|
|
38
|
+
<li>headings follow the order of the page</li>
|
|
39
|
+
<li>form fields have visible labels and clear error messages</li>
|
|
40
|
+
</ul>
|
|
41
|
+
</section>
|
|
42
|
+
|
|
43
|
+
{legal.accessibilityIssues.length > 0 && (
|
|
44
|
+
<section>
|
|
45
|
+
<h2>Problems we know about</h2>
|
|
46
|
+
<ul>
|
|
47
|
+
{legal.accessibilityIssues.map((issue) => (
|
|
48
|
+
<li key={issue}>{issue}</li>
|
|
49
|
+
))}
|
|
50
|
+
</ul>
|
|
51
|
+
</section>
|
|
52
|
+
)}
|
|
53
|
+
|
|
54
|
+
{facts.email && (
|
|
55
|
+
<section>
|
|
56
|
+
<h2>Tell us about a problem</h2>
|
|
57
|
+
<p>
|
|
58
|
+
If something on the site does not work for you, email <a href={`mailto:${facts.email}`}>{facts.email}</a> and
|
|
59
|
+
we will put it right.
|
|
60
|
+
</p>
|
|
61
|
+
</section>
|
|
62
|
+
)}
|
|
63
|
+
</main>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// The cookie policy, from dd-base (Doman-Digital/dd-library). The third
|
|
2
|
+
// parties are the processors in site.facts.ts that set cookies. Written by
|
|
3
|
+
// @domandigital/create-site.
|
|
4
|
+
|
|
5
|
+
import type { Metadata } from "next";
|
|
6
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
7
|
+
import { CookieSettingsButton } from "~site/components/CookieBanner";
|
|
8
|
+
import { JsonLd } from "~site/components/JsonLd";
|
|
9
|
+
import { facts } from "~site/facts";
|
|
10
|
+
import { legal, privacyEmail } from "~site/legal";
|
|
11
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
12
|
+
import { policy } from "~site/routes";
|
|
13
|
+
|
|
14
|
+
const TITLE = `Cookie policy: ${facts.tradingName}`;
|
|
15
|
+
const DESCRIPTION = `How ${facts.tradingName} uses cookies, and how to change your choice.`;
|
|
16
|
+
|
|
17
|
+
export const metadata: Metadata = {
|
|
18
|
+
title: TITLE,
|
|
19
|
+
description: DESCRIPTION,
|
|
20
|
+
robots: { index: isRouteIndexable(policy, "/cookies") },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const thirdParties = legal.processors.filter((p) => p.setsCookies);
|
|
24
|
+
|
|
25
|
+
export default function CookiesPage() {
|
|
26
|
+
return (
|
|
27
|
+
<main>
|
|
28
|
+
<JsonLd graph={buildPageGraph({ path: "/cookies", name: TITLE, description: DESCRIPTION })} />
|
|
29
|
+
<h1>Cookie policy</h1>
|
|
30
|
+
{legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
|
|
31
|
+
|
|
32
|
+
<section>
|
|
33
|
+
<h2>What cookies are</h2>
|
|
34
|
+
<p>Cookies are small files a website stores in your browser, to make the site work or to learn how it is used.</p>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<section>
|
|
38
|
+
<h2>What we use</h2>
|
|
39
|
+
<p>
|
|
40
|
+
<strong>Strictly necessary.</strong> Needed for the site to work, including the one that remembers your cookie
|
|
41
|
+
choice. These do not need your consent.
|
|
42
|
+
</p>
|
|
43
|
+
<p>
|
|
44
|
+
<strong>Measurement.</strong> Off until you choose "Accept measurement". They count visits and where
|
|
45
|
+
they come from.
|
|
46
|
+
</p>
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
{thirdParties.length > 0 && (
|
|
50
|
+
<section>
|
|
51
|
+
<h2>Other companies' cookies</h2>
|
|
52
|
+
<ul>
|
|
53
|
+
{thirdParties.map((p) => (
|
|
54
|
+
<li key={p.name}>
|
|
55
|
+
{p.name}: {p.purpose}
|
|
56
|
+
</li>
|
|
57
|
+
))}
|
|
58
|
+
</ul>
|
|
59
|
+
</section>
|
|
60
|
+
)}
|
|
61
|
+
|
|
62
|
+
<section>
|
|
63
|
+
<h2>Changing your choice</h2>
|
|
64
|
+
<p>You can change your choice at any time.</p>
|
|
65
|
+
<CookieSettingsButton />
|
|
66
|
+
{privacyEmail && (
|
|
67
|
+
<p>
|
|
68
|
+
Questions about cookies: <a href={`mailto:${privacyEmail}`}>{privacyEmail}</a>.
|
|
69
|
+
</p>
|
|
70
|
+
)}
|
|
71
|
+
</section>
|
|
72
|
+
</main>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// The privacy policy, from the UK GDPR baseline in dd-base
|
|
2
|
+
// (Doman-Digital/dd-library), reading every fact from site.facts.ts. A fact
|
|
3
|
+
// that is null is left out, never filled with a placeholder; launch:check
|
|
4
|
+
// fails until the ones every site needs are set. Have the client confirm it
|
|
5
|
+
// matches what the business does before launch. Written by
|
|
6
|
+
// @domandigital/create-site.
|
|
7
|
+
|
|
8
|
+
import type { Metadata } from "next";
|
|
9
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
10
|
+
import { JsonLd } from "~site/components/JsonLd";
|
|
11
|
+
import { facts } from "~site/facts";
|
|
12
|
+
import { ICO_COMPLAINTS, identity, legal, privacyEmail } from "~site/legal";
|
|
13
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
14
|
+
import { policy } from "~site/routes";
|
|
15
|
+
|
|
16
|
+
const TITLE = `Privacy policy: ${facts.tradingName}`;
|
|
17
|
+
const DESCRIPTION = `How ${facts.tradingName} collects, uses and protects personal data under the UK GDPR.`;
|
|
18
|
+
|
|
19
|
+
export const metadata: Metadata = {
|
|
20
|
+
title: TITLE,
|
|
21
|
+
description: DESCRIPTION,
|
|
22
|
+
robots: { index: isRouteIndexable(policy, "/privacy") },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default function PrivacyPage() {
|
|
26
|
+
return (
|
|
27
|
+
<main>
|
|
28
|
+
<JsonLd graph={buildPageGraph({ path: "/privacy", name: TITLE, description: DESCRIPTION })} />
|
|
29
|
+
<h1>Privacy policy</h1>
|
|
30
|
+
{legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
|
|
31
|
+
|
|
32
|
+
<section>
|
|
33
|
+
<h2>Who we are</h2>
|
|
34
|
+
<p>{identity()} is responsible for the personal data collected through this website.</p>
|
|
35
|
+
{legal.icoNumber && <p>We are registered with the Information Commissioner's Office, number {legal.icoNumber}.</p>}
|
|
36
|
+
</section>
|
|
37
|
+
|
|
38
|
+
<section>
|
|
39
|
+
<h2>What we collect</h2>
|
|
40
|
+
<p>
|
|
41
|
+
When you contact us we keep what you send: your name, how to reach you and your message. When you use the site,
|
|
42
|
+
the server records technical details such as your IP address and browser to keep it running and secure. With
|
|
43
|
+
your permission, and only then, we also measure how the site is used.
|
|
44
|
+
</p>
|
|
45
|
+
</section>
|
|
46
|
+
|
|
47
|
+
<section>
|
|
48
|
+
<h2>Why we are allowed to</h2>
|
|
49
|
+
<ul>
|
|
50
|
+
<li>Answering you and doing the work you ask for: taking steps towards a contract, or a contract, Article 6(1)(b).</li>
|
|
51
|
+
<li>Measurement cookies: your consent, Article 6(1)(a). They are off until you accept them.</li>
|
|
52
|
+
<li>Keeping the site running and secure: our legitimate interests, Article 6(1)(f).</li>
|
|
53
|
+
</ul>
|
|
54
|
+
</section>
|
|
55
|
+
|
|
56
|
+
{legal.processors.length > 0 && (
|
|
57
|
+
<section>
|
|
58
|
+
<h2>Who we share it with</h2>
|
|
59
|
+
<p>These companies handle personal data for us, under written contracts:</p>
|
|
60
|
+
<ul>
|
|
61
|
+
{legal.processors.map((p) => (
|
|
62
|
+
<li key={p.name}>
|
|
63
|
+
{p.name}: {p.purpose}
|
|
64
|
+
</li>
|
|
65
|
+
))}
|
|
66
|
+
</ul>
|
|
67
|
+
<p>We do not sell personal data.</p>
|
|
68
|
+
</section>
|
|
69
|
+
)}
|
|
70
|
+
|
|
71
|
+
{legal.retention && (
|
|
72
|
+
<section>
|
|
73
|
+
<h2>How long we keep it</h2>
|
|
74
|
+
<p>{legal.retention}</p>
|
|
75
|
+
</section>
|
|
76
|
+
)}
|
|
77
|
+
|
|
78
|
+
<section>
|
|
79
|
+
<h2>Your rights</h2>
|
|
80
|
+
<p>
|
|
81
|
+
You can ask to see, correct, delete or move your personal data, ask us to stop or limit using it, and object to
|
|
82
|
+
how we use it. Where we rely on your consent you can withdraw it at any time.
|
|
83
|
+
{privacyEmail && (
|
|
84
|
+
<>
|
|
85
|
+
{" "}Write to <a href={`mailto:${privacyEmail}`}>{privacyEmail}</a>.
|
|
86
|
+
</>
|
|
87
|
+
)}
|
|
88
|
+
</p>
|
|
89
|
+
<p>
|
|
90
|
+
If you are unhappy with our answer you can complain to the Information Commissioner's Office:{" "}
|
|
91
|
+
<a href={ICO_COMPLAINTS}>ico.org.uk/make-a-complaint</a>.
|
|
92
|
+
</p>
|
|
93
|
+
</section>
|
|
94
|
+
</main>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// The website terms, from dd-base (Doman-Digital/dd-library). The governing
|
|
2
|
+
// law is a fact in site.facts.ts, not assumed: a Scottish business is under
|
|
3
|
+
// Scots law. Written by @domandigital/create-site.
|
|
4
|
+
|
|
5
|
+
import type { Metadata } from "next";
|
|
6
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
7
|
+
import { JsonLd } from "~site/components/JsonLd";
|
|
8
|
+
import { facts } from "~site/facts";
|
|
9
|
+
import { identity, legal } from "~site/legal";
|
|
10
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
11
|
+
import { policy } from "~site/routes";
|
|
12
|
+
|
|
13
|
+
const TITLE = `Website terms: ${facts.tradingName}`;
|
|
14
|
+
const DESCRIPTION = `The terms for using ${new URL(facts.url).hostname}.`;
|
|
15
|
+
|
|
16
|
+
export const metadata: Metadata = {
|
|
17
|
+
title: TITLE,
|
|
18
|
+
description: DESCRIPTION,
|
|
19
|
+
robots: { index: isRouteIndexable(policy, "/terms") },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default function TermsPage() {
|
|
23
|
+
return (
|
|
24
|
+
<main>
|
|
25
|
+
<JsonLd graph={buildPageGraph({ path: "/terms", name: TITLE, description: DESCRIPTION })} />
|
|
26
|
+
<h1>Website terms</h1>
|
|
27
|
+
{legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
|
|
28
|
+
|
|
29
|
+
<section>
|
|
30
|
+
<h2>About these terms</h2>
|
|
31
|
+
<p>
|
|
32
|
+
These terms cover your use of {new URL(facts.url).hostname}, run by {identity()}. By using the site you accept
|
|
33
|
+
them.
|
|
34
|
+
</p>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<section>
|
|
38
|
+
<h2>Using the site</h2>
|
|
39
|
+
<p>
|
|
40
|
+
Use the site lawfully. Do not try to break into it, slow it down or spread anything harmful through it.
|
|
41
|
+
</p>
|
|
42
|
+
</section>
|
|
43
|
+
|
|
44
|
+
<section>
|
|
45
|
+
<h2>Who owns the content</h2>
|
|
46
|
+
<p>
|
|
47
|
+
The content belongs to {facts.legalName} or is used with permission. You may view it and save a copy for your
|
|
48
|
+
own use. Ask us before publishing it anywhere else.
|
|
49
|
+
</p>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<section>
|
|
53
|
+
<h2>Availability and accuracy</h2>
|
|
54
|
+
<p>
|
|
55
|
+
We work to keep the site available and correct, but cannot promise it always will be. The information here is
|
|
56
|
+
general and is not professional advice for your situation.
|
|
57
|
+
</p>
|
|
58
|
+
</section>
|
|
59
|
+
|
|
60
|
+
<section>
|
|
61
|
+
<h2>Liability</h2>
|
|
62
|
+
<p>
|
|
63
|
+
Nothing in these terms limits our liability for death or personal injury caused by our negligence, for fraud, or
|
|
64
|
+
for anything else the law does not allow us to limit. Otherwise we are not liable for indirect or consequential
|
|
65
|
+
loss from using the site.
|
|
66
|
+
</p>
|
|
67
|
+
</section>
|
|
68
|
+
|
|
69
|
+
{legal.governingLaw && (
|
|
70
|
+
<section>
|
|
71
|
+
<h2>The law that applies</h2>
|
|
72
|
+
<p>
|
|
73
|
+
These terms are governed by the law of {legal.governingLaw}, and its courts deal with any dispute about them.
|
|
74
|
+
</p>
|
|
75
|
+
</section>
|
|
76
|
+
)}
|
|
77
|
+
</main>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// The cookie banner, and the button that brings it back. Written by
|
|
4
|
+
// @domandigital/create-site, from the dd-base banner (Doman-Digital/dd-library).
|
|
5
|
+
// Unstyled: style it with the site's own classes. Put <CookieBanner /> once
|
|
6
|
+
// in the root layout; launch:check fails until it is placed.
|
|
7
|
+
//
|
|
8
|
+
// It renders nothing on the server and nothing once a choice is stored, so a
|
|
9
|
+
// returning visitor never sees it flash. The two buttons carry equal weight:
|
|
10
|
+
// refusing must be as easy as accepting.
|
|
11
|
+
|
|
12
|
+
import { useEffect, useState } from "react";
|
|
13
|
+
import { SETTINGS_EVENT, getConsent, openCookieSettings, setConsent } from "~site/consent";
|
|
14
|
+
|
|
15
|
+
export function CookieBanner({ className }: { className?: string }) {
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setOpen(getConsent() === null);
|
|
20
|
+
const reopen = () => setOpen(true);
|
|
21
|
+
window.addEventListener(SETTINGS_EVENT, reopen);
|
|
22
|
+
return () => window.removeEventListener(SETTINGS_EVENT, reopen);
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
if (!open) return null;
|
|
26
|
+
|
|
27
|
+
const decide = (measurement: boolean) => {
|
|
28
|
+
setConsent(measurement);
|
|
29
|
+
setOpen(false);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={className} role="region" aria-label="Cookie choices">
|
|
34
|
+
<p>
|
|
35
|
+
We use cookies the site needs to work. With your permission we also use measurement cookies to see how the site is
|
|
36
|
+
used. <a href="/cookies">Cookie policy</a>
|
|
37
|
+
</p>
|
|
38
|
+
<button type="button" onClick={() => decide(false)}>
|
|
39
|
+
Necessary only
|
|
40
|
+
</button>
|
|
41
|
+
<button type="button" onClick={() => decide(true)}>
|
|
42
|
+
Accept measurement
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Shows the banner again, so a visitor can change their choice. */
|
|
49
|
+
export function CookieSettingsButton({ className }: { className?: string }) {
|
|
50
|
+
return (
|
|
51
|
+
<button type="button" className={className} onClick={openCookieSettings}>
|
|
52
|
+
Change cookie settings
|
|
53
|
+
</button>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// The visitor's cookie choice, shared by the banner and anything that sets a
|
|
2
|
+
// non-essential cookie. Written by @domandigital/create-site, from the
|
|
3
|
+
// dd-base banner (Doman-Digital/dd-library).
|
|
4
|
+
//
|
|
5
|
+
// Two states: strictly necessary only (the default, and what no answer
|
|
6
|
+
// means), or measurement as well. An analytics loader calls getConsent() and
|
|
7
|
+
// loads nothing unless measurement is true, then listens for CONSENT_EVENT so
|
|
8
|
+
// a choice made on this page takes effect without a reload. Refusing is as
|
|
9
|
+
// easy as accepting, and openCookieSettings() brings the banner back so a
|
|
10
|
+
// choice can be changed as easily as it was made (ICO guidance on PECR).
|
|
11
|
+
|
|
12
|
+
export const CONSENT_KEY = "dd-cookie-consent";
|
|
13
|
+
/** Fired on window with the new ConsentRecord as detail. */
|
|
14
|
+
export const CONSENT_EVENT = "dd-cookie-consent";
|
|
15
|
+
/** Fired on window to show the banner again. */
|
|
16
|
+
export const SETTINGS_EVENT = "dd-cookie-settings";
|
|
17
|
+
|
|
18
|
+
export type ConsentRecord = { measurement: boolean; decidedAt: string; version: "v1" };
|
|
19
|
+
|
|
20
|
+
export function getConsent(): ConsentRecord | null {
|
|
21
|
+
if (typeof window === "undefined") return null;
|
|
22
|
+
try {
|
|
23
|
+
const raw = window.localStorage.getItem(CONSENT_KEY);
|
|
24
|
+
if (!raw) return null;
|
|
25
|
+
const parsed = JSON.parse(raw) as ConsentRecord;
|
|
26
|
+
return parsed.version === "v1" && typeof parsed.measurement === "boolean" ? parsed : null;
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function setConsent(measurement: boolean): ConsentRecord {
|
|
33
|
+
const record: ConsentRecord = { measurement, decidedAt: new Date().toISOString(), version: "v1" };
|
|
34
|
+
try {
|
|
35
|
+
window.localStorage.setItem(CONSENT_KEY, JSON.stringify(record));
|
|
36
|
+
} catch {
|
|
37
|
+
// Storage blocked: the choice holds for this page, and the banner asks again next visit.
|
|
38
|
+
}
|
|
39
|
+
window.dispatchEvent(new CustomEvent(CONSENT_EVENT, { detail: record }));
|
|
40
|
+
return record;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function openCookieSettings(): void {
|
|
44
|
+
window.dispatchEvent(new Event(SETTINGS_EVENT));
|
|
45
|
+
}
|
|
@@ -43,6 +43,40 @@ export type Profile = {
|
|
|
43
43
|
status: "to-claim" | "claimed" | "live";
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
/** A company the site sends personal data to, as the privacy and cookie pages list it. */
|
|
47
|
+
export type Processor = {
|
|
48
|
+
name: string;
|
|
49
|
+
/** What it does for the site, e.g. "hosting", "enquiry email". */
|
|
50
|
+
purpose: string;
|
|
51
|
+
/** Sets cookies in the visitor's browser. Measurement ones load only after consent. */
|
|
52
|
+
setsCookies: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* What the privacy, cookie, terms and accessibility pages need. Unknown is
|
|
57
|
+
* null; a page leaves out what is null rather than print a placeholder, and
|
|
58
|
+
* launch:check fails until the ones every site needs are filled in.
|
|
59
|
+
*/
|
|
60
|
+
export type LegalFacts = {
|
|
61
|
+
/** Companies House number. null for a sole trader or a partnership. */
|
|
62
|
+
companyNumber: string | null;
|
|
63
|
+
/** Registered office on one line, as Companies House shows it. */
|
|
64
|
+
registeredOffice: string | null;
|
|
65
|
+
/** ICO data protection fee registration number. */
|
|
66
|
+
icoNumber: string | null;
|
|
67
|
+
/** Where privacy requests go, if not the main email. */
|
|
68
|
+
privacyEmail: string | null;
|
|
69
|
+
/** How long enquiries and customer records are kept, in a sentence. */
|
|
70
|
+
retention: string | null;
|
|
71
|
+
processors: Processor[];
|
|
72
|
+
/** The law the website terms are under, e.g. "England and Wales" or "Scotland". */
|
|
73
|
+
governingLaw: string | null;
|
|
74
|
+
/** Accessibility problems someone found and has not fixed yet. */
|
|
75
|
+
accessibilityIssues: string[];
|
|
76
|
+
/** ISO date someone last read the legal pages against what the site does. */
|
|
77
|
+
reviewedOn: string | null;
|
|
78
|
+
};
|
|
79
|
+
|
|
46
80
|
export type SiteFacts = {
|
|
47
81
|
/** The canonical origin, https, no trailing slash. */
|
|
48
82
|
url: string;
|
|
@@ -68,6 +102,8 @@ export type SiteFacts = {
|
|
|
68
102
|
profiles: Profile[];
|
|
69
103
|
/** Hostnames of previous sites that now redirect here, for the redirect check. */
|
|
70
104
|
previousHosts: string[];
|
|
105
|
+
/** Optional so a facts file written before the legal pages still compiles. */
|
|
106
|
+
legal?: LegalFacts;
|
|
71
107
|
};
|
|
72
108
|
|
|
73
109
|
const DAY_NAMES: Record<Day, string> = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// The legal pages' facts, with every field present. A facts file written
|
|
2
|
+
// before the legal pages has no `legal` block; it reads as all unknown.
|
|
3
|
+
// Written by @domandigital/create-site.
|
|
4
|
+
|
|
5
|
+
import { facts } from "~site/facts";
|
|
6
|
+
import type { LegalFacts } from "~site/site-adapter";
|
|
7
|
+
|
|
8
|
+
export const legal: LegalFacts = {
|
|
9
|
+
companyNumber: null,
|
|
10
|
+
registeredOffice: null,
|
|
11
|
+
icoNumber: null,
|
|
12
|
+
privacyEmail: null,
|
|
13
|
+
retention: null,
|
|
14
|
+
processors: [],
|
|
15
|
+
governingLaw: null,
|
|
16
|
+
accessibilityIssues: [],
|
|
17
|
+
reviewedOn: null,
|
|
18
|
+
...facts.legal,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Where a privacy request goes: the privacy address, else the main one. */
|
|
22
|
+
export const privacyEmail: string | null = legal.privacyEmail ?? facts.email;
|
|
23
|
+
|
|
24
|
+
/** "Acme Ltd, company number 01234567, registered office 1 High Street, Leeds" with what is known. */
|
|
25
|
+
export function identity(): string {
|
|
26
|
+
const parts = [facts.legalName];
|
|
27
|
+
if (legal.companyNumber) parts.push(`company number ${legal.companyNumber}`);
|
|
28
|
+
if (legal.registeredOffice) parts.push(`registered office ${legal.registeredOffice}`);
|
|
29
|
+
return parts.join(", ");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** ICO's own page for complaints. A regulator's address, not the business's. */
|
|
33
|
+
export const ICO_COMPLAINTS = "https://ico.org.uk/make-a-complaint/";
|