@domandigital/create-site 0.3.2 → 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.
@@ -0,0 +1,65 @@
1
+ ---
2
+ // The accessibility statement, from dd-base (Doman-Digital/dd-library). It
3
+ // states the standard the house builds to and the problems someone has
4
+ // actually found; it claims nothing it has not checked. A whole document:
5
+ // move it into your layout. 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 { legal } from "~site/legal";
10
+ import { buildPageGraph } from "~site/page-graph";
11
+ import { policy } from "~site/routes";
12
+
13
+ const title = `Accessibility: ${facts.tradingName}`;
14
+ const description = `How ${facts.tradingName} makes this website usable by everyone, and how to tell us when it is not.`;
15
+ const indexable = isRouteIndexable(policy, "/accessibility");
16
+ ---
17
+
18
+ <html lang="en-GB">
19
+ <head>
20
+ <meta charset="utf-8" />
21
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
22
+ <title>{title}</title>
23
+ <meta name="description" content={description} />
24
+ {!indexable && <meta name="robots" content="noindex" />}
25
+ <JsonLd graph={buildPageGraph({ path: "/accessibility", name: title, description })} />
26
+ </head>
27
+ <body>
28
+ <main>
29
+ <h1>Accessibility</h1>
30
+ {legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
31
+
32
+ <section>
33
+ <h2>The standard we build to</h2>
34
+ <p>We aim for this site to meet the Web Content Accessibility Guidelines (WCAG) 2.2 at level AA. That means:</p>
35
+ <ul>
36
+ <li>text has enough contrast against its background</li>
37
+ <li>everything works with a keyboard</li>
38
+ <li>images that carry meaning have a text alternative</li>
39
+ <li>movement stops when your device asks for reduced motion</li>
40
+ <li>headings follow the order of the page</li>
41
+ <li>form fields have visible labels and clear error messages</li>
42
+ </ul>
43
+ </section>
44
+
45
+ {legal.accessibilityIssues.length > 0 && (
46
+ <section>
47
+ <h2>Problems we know about</h2>
48
+ <ul>
49
+ {legal.accessibilityIssues.map((issue) => <li>{issue}</li>)}
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
+ </body>
65
+ </html>
@@ -0,0 +1,72 @@
1
+ ---
2
+ // The cookie policy, from dd-base (Doman-Digital/dd-library). The third
3
+ // parties are the processors in site.facts.ts that set cookies. The button
4
+ // brings back the banner the site's layout carries. A whole document: move
5
+ // it into your layout. 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 { legal, privacyEmail } from "~site/legal";
10
+ import { buildPageGraph } from "~site/page-graph";
11
+ import { policy } from "~site/routes";
12
+
13
+ const title = `Cookie policy: ${facts.tradingName}`;
14
+ const description = `How ${facts.tradingName} uses cookies, and how to change your choice.`;
15
+ const indexable = isRouteIndexable(policy, "/cookies");
16
+ const thirdParties = legal.processors.filter((p) => p.setsCookies);
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: "/cookies", name: title, description })} />
27
+ </head>
28
+ <body>
29
+ <main>
30
+ <h1>Cookie policy</h1>
31
+ {legal.reviewedOn && <p>Last reviewed {legal.reviewedOn}.</p>}
32
+
33
+ <section>
34
+ <h2>What cookies are</h2>
35
+ <p>Cookies are small files a website stores in your browser, to make the site work or to learn how it is used.</p>
36
+ </section>
37
+
38
+ <section>
39
+ <h2>What we use</h2>
40
+ <p>
41
+ <strong>Strictly necessary.</strong> Needed for the site to work, including the one that remembers your cookie
42
+ choice. These do not need your consent.
43
+ </p>
44
+ <p>
45
+ <strong>Measurement.</strong> Off until you choose "Accept measurement". They count visits and where they come
46
+ from.
47
+ </p>
48
+ </section>
49
+
50
+ {thirdParties.length > 0 && (
51
+ <section>
52
+ <h2>Other companies' cookies</h2>
53
+ <ul>
54
+ {thirdParties.map((p) => <li>{p.name}: {p.purpose}</li>)}
55
+ </ul>
56
+ </section>
57
+ )}
58
+
59
+ <section>
60
+ <h2>Changing your choice</h2>
61
+ <p>You can change your choice at any time.</p>
62
+ <button type="button" data-cookie-settings>Change cookie settings</button>
63
+ {privacyEmail && <p>Questions about cookies: <a href={`mailto:${privacyEmail}`}>{privacyEmail}</a>.</p>}
64
+ </section>
65
+ </main>
66
+ <script>
67
+ import { openCookieSettings } from "~site/consent";
68
+
69
+ document.querySelectorAll("[data-cookie-settings]").forEach((el) => el.addEventListener("click", openCookieSettings));
70
+ </script>
71
+ </body>
72
+ </html>
@@ -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 &quot;Accept measurement&quot;. They count visits and where
45
+ they come from.
46
+ </p>
47
+ </section>
48
+
49
+ {thirdParties.length > 0 && (
50
+ <section>
51
+ <h2>Other companies&apos; 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&apos;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&apos;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
+ }