@domandigital/create-site 0.1.0 → 0.3.1
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 +34 -7
- package/LICENSE +202 -202
- package/README.md +104 -98
- package/dist/cli.js +61 -46
- package/package.json +3 -3
- package/templates/astro/components/DesignerCredit.astro +17 -17
- package/templates/astro/components/JsonLd.astro +14 -14
- package/templates/astro/pages/press.astro +86 -86
- package/templates/astro/pages/resources/index.astro +35 -35
- package/templates/astro/tests/seo/config.test.ts +18 -18
- package/templates/astro/tests/seo/routes-on-disk.ts +51 -51
- package/templates/next/app/press/page.tsx +96 -96
- package/templates/next/app/resources/page.tsx +32 -32
- package/templates/next/components/DesignerCredit.tsx +16 -16
- package/templates/next/components/JsonLd.tsx +11 -11
- package/templates/next/tests/seo/config.test.ts +15 -15
- package/templates/next/tests/seo/routes-on-disk.ts +55 -55
- package/templates/shared/lib/graph/page-graph.ts +37 -37
- package/templates/shared/lib/graph/site-adapter.ts +104 -104
- package/templates/shared/tests/house.test.ts +69 -69
- package/templates/shared/tests/seo/coverage.test.ts +20 -20
- package/templates/shared/tests/seo/graph.test.ts +16 -16
- package/templates/shared/tests/seo/redirects.test.ts +25 -25
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
---
|
|
2
|
-
// The press page: company facts, checked accreditations, press contact and
|
|
3
|
-
// earned coverage, all read from the site's data files. A section with no
|
|
4
|
-
// data is not rendered, so nothing is invented. A whole document, because a
|
|
5
|
-
// fresh Astro site may have no layout yet: move it into yours.
|
|
6
|
-
// Written by @domandigital/create-site.
|
|
7
|
-
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
-
import type { BacklinkRegister } from "@domandigital/seo";
|
|
9
|
-
import JsonLd from "~site/components/JsonLd.astro";
|
|
10
|
-
import { facts } from "~site/facts";
|
|
11
|
-
import links from "~site/links.json";
|
|
12
|
-
import { buildPageGraph } from "~site/page-graph";
|
|
13
|
-
import { policy } from "~site/routes";
|
|
14
|
-
|
|
15
|
-
const title = `Press: ${facts.tradingName}`;
|
|
16
|
-
const indexable = isRouteIndexable(policy, "/press");
|
|
17
|
-
const accreditations = facts.accreditations.filter((a) => a.registerUrl && a.verifiedOn);
|
|
18
|
-
const coverage = (links as BacklinkRegister).links.filter((l) => l.kind === "press" && l.status === "live");
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
<html lang="en-GB">
|
|
22
|
-
<head>
|
|
23
|
-
<meta charset="utf-8" />
|
|
24
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
25
|
-
<title>{title}</title>
|
|
26
|
-
<meta name="description" content={facts.description} />
|
|
27
|
-
{!indexable && <meta name="robots" content="noindex" />}
|
|
28
|
-
<JsonLd graph={buildPageGraph({ path: "/press", name: title, description: facts.description })} />
|
|
29
|
-
</head>
|
|
30
|
-
<body>
|
|
31
|
-
<main>
|
|
32
|
-
<h1>Press</h1>
|
|
33
|
-
|
|
34
|
-
<section>
|
|
35
|
-
<h2>About {facts.tradingName}</h2>
|
|
36
|
-
<p>{facts.description}</p>
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
<section>
|
|
40
|
-
<h2>Company facts</h2>
|
|
41
|
-
<dl>
|
|
42
|
-
<dt>Registered name</dt>
|
|
43
|
-
<dd>{facts.legalName}</dd>
|
|
44
|
-
{facts.serviceAreas.length > 0 && (
|
|
45
|
-
<>
|
|
46
|
-
<dt>Areas served</dt>
|
|
47
|
-
<dd>{facts.serviceAreas.join(", ")}</dd>
|
|
48
|
-
</>
|
|
49
|
-
)}
|
|
50
|
-
<dt>Website</dt>
|
|
51
|
-
<dd>{facts.url}</dd>
|
|
52
|
-
</dl>
|
|
53
|
-
</section>
|
|
54
|
-
|
|
55
|
-
{accreditations.length > 0 && (
|
|
56
|
-
<section>
|
|
57
|
-
<h2>Accreditations</h2>
|
|
58
|
-
<ul>
|
|
59
|
-
{accreditations.map((a) => (
|
|
60
|
-
<li><a href={a.registerUrl}>{a.name}</a></li>
|
|
61
|
-
))}
|
|
62
|
-
</ul>
|
|
63
|
-
</section>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
{(facts.email || facts.phone) && (
|
|
67
|
-
<section>
|
|
68
|
-
<h2>Press contact</h2>
|
|
69
|
-
{facts.email && <p><a href={`mailto:${facts.email}`}>{facts.email}</a></p>}
|
|
70
|
-
{facts.phone && <p><a href={`tel:${facts.phone.replace(/\s+/g, "")}`}>{facts.phone}</a></p>}
|
|
71
|
-
</section>
|
|
72
|
-
)}
|
|
73
|
-
|
|
74
|
-
{coverage.length > 0 && (
|
|
75
|
-
<section>
|
|
76
|
-
<h2>Coverage</h2>
|
|
77
|
-
<ul>
|
|
78
|
-
{coverage.map((c) => (
|
|
79
|
-
<li><a href={c.url}>{c.source}</a></li>
|
|
80
|
-
))}
|
|
81
|
-
</ul>
|
|
82
|
-
</section>
|
|
83
|
-
)}
|
|
84
|
-
</main>
|
|
85
|
-
</body>
|
|
86
|
-
</html>
|
|
1
|
+
---
|
|
2
|
+
// The press page: company facts, checked accreditations, press contact and
|
|
3
|
+
// earned coverage, all read from the site's data files. A section with no
|
|
4
|
+
// data is not rendered, so nothing is invented. A whole document, because a
|
|
5
|
+
// fresh Astro site may have no layout yet: move it into yours.
|
|
6
|
+
// Written by @domandigital/create-site.
|
|
7
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
+
import type { BacklinkRegister } from "@domandigital/seo";
|
|
9
|
+
import JsonLd from "~site/components/JsonLd.astro";
|
|
10
|
+
import { facts } from "~site/facts";
|
|
11
|
+
import links from "~site/links.json";
|
|
12
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
13
|
+
import { policy } from "~site/routes";
|
|
14
|
+
|
|
15
|
+
const title = `Press: ${facts.tradingName}`;
|
|
16
|
+
const indexable = isRouteIndexable(policy, "/press");
|
|
17
|
+
const accreditations = facts.accreditations.filter((a) => a.registerUrl && a.verifiedOn);
|
|
18
|
+
const coverage = (links as BacklinkRegister).links.filter((l) => l.kind === "press" && l.status === "live");
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<html lang="en-GB">
|
|
22
|
+
<head>
|
|
23
|
+
<meta charset="utf-8" />
|
|
24
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
25
|
+
<title>{title}</title>
|
|
26
|
+
<meta name="description" content={facts.description} />
|
|
27
|
+
{!indexable && <meta name="robots" content="noindex" />}
|
|
28
|
+
<JsonLd graph={buildPageGraph({ path: "/press", name: title, description: facts.description })} />
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<main>
|
|
32
|
+
<h1>Press</h1>
|
|
33
|
+
|
|
34
|
+
<section>
|
|
35
|
+
<h2>About {facts.tradingName}</h2>
|
|
36
|
+
<p>{facts.description}</p>
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
<section>
|
|
40
|
+
<h2>Company facts</h2>
|
|
41
|
+
<dl>
|
|
42
|
+
<dt>Registered name</dt>
|
|
43
|
+
<dd>{facts.legalName}</dd>
|
|
44
|
+
{facts.serviceAreas.length > 0 && (
|
|
45
|
+
<>
|
|
46
|
+
<dt>Areas served</dt>
|
|
47
|
+
<dd>{facts.serviceAreas.join(", ")}</dd>
|
|
48
|
+
</>
|
|
49
|
+
)}
|
|
50
|
+
<dt>Website</dt>
|
|
51
|
+
<dd>{facts.url}</dd>
|
|
52
|
+
</dl>
|
|
53
|
+
</section>
|
|
54
|
+
|
|
55
|
+
{accreditations.length > 0 && (
|
|
56
|
+
<section>
|
|
57
|
+
<h2>Accreditations</h2>
|
|
58
|
+
<ul>
|
|
59
|
+
{accreditations.map((a) => (
|
|
60
|
+
<li><a href={a.registerUrl}>{a.name}</a></li>
|
|
61
|
+
))}
|
|
62
|
+
</ul>
|
|
63
|
+
</section>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{(facts.email || facts.phone) && (
|
|
67
|
+
<section>
|
|
68
|
+
<h2>Press contact</h2>
|
|
69
|
+
{facts.email && <p><a href={`mailto:${facts.email}`}>{facts.email}</a></p>}
|
|
70
|
+
{facts.phone && <p><a href={`tel:${facts.phone.replace(/\s+/g, "")}`}>{facts.phone}</a></p>}
|
|
71
|
+
</section>
|
|
72
|
+
)}
|
|
73
|
+
|
|
74
|
+
{coverage.length > 0 && (
|
|
75
|
+
<section>
|
|
76
|
+
<h2>Coverage</h2>
|
|
77
|
+
<ul>
|
|
78
|
+
{coverage.map((c) => (
|
|
79
|
+
<li><a href={c.url}>{c.source}</a></li>
|
|
80
|
+
))}
|
|
81
|
+
</ul>
|
|
82
|
+
</section>
|
|
83
|
+
)}
|
|
84
|
+
</main>
|
|
85
|
+
</body>
|
|
86
|
+
</html>
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
---
|
|
2
|
-
// The home for the site's linkable assets: a cost guide from the client's own
|
|
3
|
-
// job data, a calculator, or a practical guide. Kept out of the index until
|
|
4
|
-
// the first one ships: flip /resources to indexable in site.routes.ts then.
|
|
5
|
-
// Written by @domandigital/create-site.
|
|
6
|
-
import { isRouteIndexable } from "@domandigital/seo";
|
|
7
|
-
import { facts } from "~site/facts";
|
|
8
|
-
import { linkableAssets, policy } from "~site/routes";
|
|
9
|
-
|
|
10
|
-
const indexable = isRouteIndexable(policy, "/resources");
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<html lang="en-GB">
|
|
14
|
-
<head>
|
|
15
|
-
<meta charset="utf-8" />
|
|
16
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
17
|
-
<title>Resources: {facts.tradingName}</title>
|
|
18
|
-
{!indexable && <meta name="robots" content="noindex" />}
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
<main>
|
|
22
|
-
<h1>Resources</h1>
|
|
23
|
-
{linkableAssets.length > 0 && (
|
|
24
|
-
<ul>
|
|
25
|
-
{linkableAssets.map((asset) => (
|
|
26
|
-
<li>
|
|
27
|
-
<a href={asset.path}>{asset.title}</a>
|
|
28
|
-
<p>{asset.summary}</p>
|
|
29
|
-
</li>
|
|
30
|
-
))}
|
|
31
|
-
</ul>
|
|
32
|
-
)}
|
|
33
|
-
</main>
|
|
34
|
-
</body>
|
|
35
|
-
</html>
|
|
1
|
+
---
|
|
2
|
+
// The home for the site's linkable assets: a cost guide from the client's own
|
|
3
|
+
// job data, a calculator, or a practical guide. Kept out of the index until
|
|
4
|
+
// the first one ships: flip /resources to indexable in site.routes.ts then.
|
|
5
|
+
// Written by @domandigital/create-site.
|
|
6
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
7
|
+
import { facts } from "~site/facts";
|
|
8
|
+
import { linkableAssets, policy } from "~site/routes";
|
|
9
|
+
|
|
10
|
+
const indexable = isRouteIndexable(policy, "/resources");
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<html lang="en-GB">
|
|
14
|
+
<head>
|
|
15
|
+
<meta charset="utf-8" />
|
|
16
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
17
|
+
<title>Resources: {facts.tradingName}</title>
|
|
18
|
+
{!indexable && <meta name="robots" content="noindex" />}
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<main>
|
|
22
|
+
<h1>Resources</h1>
|
|
23
|
+
{linkableAssets.length > 0 && (
|
|
24
|
+
<ul>
|
|
25
|
+
{linkableAssets.map((asset) => (
|
|
26
|
+
<li>
|
|
27
|
+
<a href={asset.path}>{asset.title}</a>
|
|
28
|
+
<p>{asset.summary}</p>
|
|
29
|
+
</li>
|
|
30
|
+
))}
|
|
31
|
+
</ul>
|
|
32
|
+
)}
|
|
33
|
+
</main>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
// astro.config serves exactly the redirects in redirects.json. Written by
|
|
2
|
-
// @domandigital/create-site; fails until the config reads redirects.json.
|
|
3
|
-
//
|
|
4
|
-
// Static output turns these into meta-refresh pages, not real 301s. For a
|
|
5
|
-
// migration, deploy with a host adapter or add host-level redirects.
|
|
6
|
-
|
|
7
|
-
import { describe, expect, test } from "vitest";
|
|
8
|
-
import type { RedirectsFile } from "@domandigital/seo";
|
|
9
|
-
import config from "~site/framework-config";
|
|
10
|
-
import redirectsFile from "~site/redirects.json";
|
|
11
|
-
|
|
12
|
-
describe("astro.config redirects", () => {
|
|
13
|
-
test("serves every redirect in redirects.json, and nothing else", () => {
|
|
14
|
-
const served = Object.entries(config.redirects ?? {}).map(([from, r]) => [from, typeof r === "string" ? r : r.destination]);
|
|
15
|
-
const listed = (redirectsFile as RedirectsFile).redirects;
|
|
16
|
-
expect(served).toEqual(listed.map((r) => [r.from, r.to]));
|
|
17
|
-
});
|
|
18
|
-
});
|
|
1
|
+
// astro.config serves exactly the redirects in redirects.json. Written by
|
|
2
|
+
// @domandigital/create-site; fails until the config reads redirects.json.
|
|
3
|
+
//
|
|
4
|
+
// Static output turns these into meta-refresh pages, not real 301s. For a
|
|
5
|
+
// migration, deploy with a host adapter or add host-level redirects.
|
|
6
|
+
|
|
7
|
+
import { describe, expect, test } from "vitest";
|
|
8
|
+
import type { RedirectsFile } from "@domandigital/seo";
|
|
9
|
+
import config from "~site/framework-config";
|
|
10
|
+
import redirectsFile from "~site/redirects.json";
|
|
11
|
+
|
|
12
|
+
describe("astro.config redirects", () => {
|
|
13
|
+
test("serves every redirect in redirects.json, and nothing else", () => {
|
|
14
|
+
const served = Object.entries(config.redirects ?? {}).map(([from, r]) => [from, typeof r === "string" ? r : r.destination]);
|
|
15
|
+
const listed = (redirectsFile as RedirectsFile).redirects;
|
|
16
|
+
expect(served).toEqual(listed.map((r) => [r.from, r.to]));
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
// The pages under src/pages, as the two lists validateCoverage takes. Written
|
|
2
|
-
// by @domandigital/create-site; the generator seeds site.routes.ts from the
|
|
3
|
-
// same file, so the two cannot disagree.
|
|
4
|
-
//
|
|
5
|
-
// routesOnDisk() concrete URL paths: "/", "/press"
|
|
6
|
-
// dynamicRoutesOnDisk() bracket paths: "/blog/[slug]", "/docs/[...slug]"
|
|
7
|
-
//
|
|
8
|
-
// Skipped: "_x" files and folders (Astro ignores them), endpoints (.ts/.js),
|
|
9
|
-
// and the 404 and 500 pages, which are never indexed.
|
|
10
|
-
|
|
11
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
12
|
-
import { join } from "node:path";
|
|
13
|
-
|
|
14
|
-
const PAGE_FILE = /^(.+)\.(astro|md|mdx|html)$/;
|
|
15
|
-
const NOT_PAGES = new Set(["404", "500"]);
|
|
16
|
-
|
|
17
|
-
function walk(root: string): { routes: string[]; dynamicRoutes: string[] } {
|
|
18
|
-
const pagesDir = join(root, "src", "pages");
|
|
19
|
-
const routes = new Set<string>();
|
|
20
|
-
const dynamicRoutes = new Set<string>();
|
|
21
|
-
if (!existsSync(pagesDir)) return { routes: [], dynamicRoutes: [] };
|
|
22
|
-
|
|
23
|
-
const visit = (dir: string, segments: string[]) => {
|
|
24
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
25
|
-
const name = entry.name;
|
|
26
|
-
if (name.startsWith("_")) continue;
|
|
27
|
-
if (entry.isDirectory()) {
|
|
28
|
-
visit(join(dir, name), [...segments, name]);
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
const match = PAGE_FILE.exec(name);
|
|
32
|
-
if (!match) continue;
|
|
33
|
-
const base = match[1]!;
|
|
34
|
-
if (segments.length === 0 && NOT_PAGES.has(base)) continue;
|
|
35
|
-
const parts = base === "index" ? segments : [...segments, base];
|
|
36
|
-
const path = `/${parts.join("/")}`;
|
|
37
|
-
(parts.some((p) => p.startsWith("[")) ? dynamicRoutes : routes).add(path);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
visit(pagesDir, []);
|
|
42
|
-
return { routes: [...routes].sort(), dynamicRoutes: [...dynamicRoutes].sort() };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function routesOnDisk(root: string = process.cwd()): string[] {
|
|
46
|
-
return walk(root).routes;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function dynamicRoutesOnDisk(root: string = process.cwd()): string[] {
|
|
50
|
-
return walk(root).dynamicRoutes;
|
|
51
|
-
}
|
|
1
|
+
// The pages under src/pages, as the two lists validateCoverage takes. Written
|
|
2
|
+
// by @domandigital/create-site; the generator seeds site.routes.ts from the
|
|
3
|
+
// same file, so the two cannot disagree.
|
|
4
|
+
//
|
|
5
|
+
// routesOnDisk() concrete URL paths: "/", "/press"
|
|
6
|
+
// dynamicRoutesOnDisk() bracket paths: "/blog/[slug]", "/docs/[...slug]"
|
|
7
|
+
//
|
|
8
|
+
// Skipped: "_x" files and folders (Astro ignores them), endpoints (.ts/.js),
|
|
9
|
+
// and the 404 and 500 pages, which are never indexed.
|
|
10
|
+
|
|
11
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
|
|
14
|
+
const PAGE_FILE = /^(.+)\.(astro|md|mdx|html)$/;
|
|
15
|
+
const NOT_PAGES = new Set(["404", "500"]);
|
|
16
|
+
|
|
17
|
+
function walk(root: string): { routes: string[]; dynamicRoutes: string[] } {
|
|
18
|
+
const pagesDir = join(root, "src", "pages");
|
|
19
|
+
const routes = new Set<string>();
|
|
20
|
+
const dynamicRoutes = new Set<string>();
|
|
21
|
+
if (!existsSync(pagesDir)) return { routes: [], dynamicRoutes: [] };
|
|
22
|
+
|
|
23
|
+
const visit = (dir: string, segments: string[]) => {
|
|
24
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
25
|
+
const name = entry.name;
|
|
26
|
+
if (name.startsWith("_")) continue;
|
|
27
|
+
if (entry.isDirectory()) {
|
|
28
|
+
visit(join(dir, name), [...segments, name]);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const match = PAGE_FILE.exec(name);
|
|
32
|
+
if (!match) continue;
|
|
33
|
+
const base = match[1]!;
|
|
34
|
+
if (segments.length === 0 && NOT_PAGES.has(base)) continue;
|
|
35
|
+
const parts = base === "index" ? segments : [...segments, base];
|
|
36
|
+
const path = `/${parts.join("/")}`;
|
|
37
|
+
(parts.some((p) => p.startsWith("[")) ? dynamicRoutes : routes).add(path);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
visit(pagesDir, []);
|
|
42
|
+
return { routes: [...routes].sort(), dynamicRoutes: [...dynamicRoutes].sort() };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function routesOnDisk(root: string = process.cwd()): string[] {
|
|
46
|
+
return walk(root).routes;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function dynamicRoutesOnDisk(root: string = process.cwd()): string[] {
|
|
50
|
+
return walk(root).dynamicRoutes;
|
|
51
|
+
}
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
// The press page: company facts, checked accreditations, press contact and
|
|
2
|
-
// earned coverage, all read from the site's data files. A section with no
|
|
3
|
-
// data is not rendered, so nothing is invented. Written by
|
|
4
|
-
// @domandigital/create-site.
|
|
5
|
-
|
|
6
|
-
import type { Metadata } from "next";
|
|
7
|
-
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
-
import type { BacklinkRegister } from "@domandigital/seo";
|
|
9
|
-
import { JsonLd } from "~site/components/JsonLd";
|
|
10
|
-
import { facts } from "~site/facts";
|
|
11
|
-
import links from "~site/links.json";
|
|
12
|
-
import { buildPageGraph } from "~site/page-graph";
|
|
13
|
-
import { policy } from "~site/routes";
|
|
14
|
-
|
|
15
|
-
const TITLE = `Press: ${facts.tradingName}`;
|
|
16
|
-
|
|
17
|
-
export const metadata: Metadata = {
|
|
18
|
-
title: TITLE,
|
|
19
|
-
description: facts.description,
|
|
20
|
-
robots: { index: isRouteIndexable(policy, "/press") },
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const accreditations = facts.accreditations.filter((a) => a.registerUrl && a.verifiedOn);
|
|
24
|
-
const coverage = (links as BacklinkRegister).links.filter((l) => l.kind === "press" && l.status === "live");
|
|
25
|
-
|
|
26
|
-
export default function PressPage() {
|
|
27
|
-
return (
|
|
28
|
-
<main>
|
|
29
|
-
<JsonLd graph={buildPageGraph({ path: "/press", name: TITLE, description: facts.description })} />
|
|
30
|
-
<h1>Press</h1>
|
|
31
|
-
|
|
32
|
-
<section>
|
|
33
|
-
<h2>About {facts.tradingName}</h2>
|
|
34
|
-
<p>{facts.description}</p>
|
|
35
|
-
</section>
|
|
36
|
-
|
|
37
|
-
<section>
|
|
38
|
-
<h2>Company facts</h2>
|
|
39
|
-
<dl>
|
|
40
|
-
<dt>Registered name</dt>
|
|
41
|
-
<dd>{facts.legalName}</dd>
|
|
42
|
-
{facts.serviceAreas.length > 0 && (
|
|
43
|
-
<>
|
|
44
|
-
<dt>Areas served</dt>
|
|
45
|
-
<dd>{facts.serviceAreas.join(", ")}</dd>
|
|
46
|
-
</>
|
|
47
|
-
)}
|
|
48
|
-
<dt>Website</dt>
|
|
49
|
-
<dd>{facts.url}</dd>
|
|
50
|
-
</dl>
|
|
51
|
-
</section>
|
|
52
|
-
|
|
53
|
-
{accreditations.length > 0 && (
|
|
54
|
-
<section>
|
|
55
|
-
<h2>Accreditations</h2>
|
|
56
|
-
<ul>
|
|
57
|
-
{accreditations.map((a) => (
|
|
58
|
-
<li key={a.name}>
|
|
59
|
-
<a href={a.registerUrl ?? undefined}>{a.name}</a>
|
|
60
|
-
</li>
|
|
61
|
-
))}
|
|
62
|
-
</ul>
|
|
63
|
-
</section>
|
|
64
|
-
)}
|
|
65
|
-
|
|
66
|
-
{(facts.email || facts.phone) && (
|
|
67
|
-
<section>
|
|
68
|
-
<h2>Press contact</h2>
|
|
69
|
-
{facts.email && (
|
|
70
|
-
<p>
|
|
71
|
-
<a href={`mailto:${facts.email}`}>{facts.email}</a>
|
|
72
|
-
</p>
|
|
73
|
-
)}
|
|
74
|
-
{facts.phone && (
|
|
75
|
-
<p>
|
|
76
|
-
<a href={`tel:${facts.phone.replace(/\s+/g, "")}`}>{facts.phone}</a>
|
|
77
|
-
</p>
|
|
78
|
-
)}
|
|
79
|
-
</section>
|
|
80
|
-
)}
|
|
81
|
-
|
|
82
|
-
{coverage.length > 0 && (
|
|
83
|
-
<section>
|
|
84
|
-
<h2>Coverage</h2>
|
|
85
|
-
<ul>
|
|
86
|
-
{coverage.map((c) => (
|
|
87
|
-
<li key={c.url}>
|
|
88
|
-
<a href={c.url}>{c.source}</a>
|
|
89
|
-
</li>
|
|
90
|
-
))}
|
|
91
|
-
</ul>
|
|
92
|
-
</section>
|
|
93
|
-
)}
|
|
94
|
-
</main>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
1
|
+
// The press page: company facts, checked accreditations, press contact and
|
|
2
|
+
// earned coverage, all read from the site's data files. A section with no
|
|
3
|
+
// data is not rendered, so nothing is invented. Written by
|
|
4
|
+
// @domandigital/create-site.
|
|
5
|
+
|
|
6
|
+
import type { Metadata } from "next";
|
|
7
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
+
import type { BacklinkRegister } from "@domandigital/seo";
|
|
9
|
+
import { JsonLd } from "~site/components/JsonLd";
|
|
10
|
+
import { facts } from "~site/facts";
|
|
11
|
+
import links from "~site/links.json";
|
|
12
|
+
import { buildPageGraph } from "~site/page-graph";
|
|
13
|
+
import { policy } from "~site/routes";
|
|
14
|
+
|
|
15
|
+
const TITLE = `Press: ${facts.tradingName}`;
|
|
16
|
+
|
|
17
|
+
export const metadata: Metadata = {
|
|
18
|
+
title: TITLE,
|
|
19
|
+
description: facts.description,
|
|
20
|
+
robots: { index: isRouteIndexable(policy, "/press") },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const accreditations = facts.accreditations.filter((a) => a.registerUrl && a.verifiedOn);
|
|
24
|
+
const coverage = (links as BacklinkRegister).links.filter((l) => l.kind === "press" && l.status === "live");
|
|
25
|
+
|
|
26
|
+
export default function PressPage() {
|
|
27
|
+
return (
|
|
28
|
+
<main>
|
|
29
|
+
<JsonLd graph={buildPageGraph({ path: "/press", name: TITLE, description: facts.description })} />
|
|
30
|
+
<h1>Press</h1>
|
|
31
|
+
|
|
32
|
+
<section>
|
|
33
|
+
<h2>About {facts.tradingName}</h2>
|
|
34
|
+
<p>{facts.description}</p>
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
<section>
|
|
38
|
+
<h2>Company facts</h2>
|
|
39
|
+
<dl>
|
|
40
|
+
<dt>Registered name</dt>
|
|
41
|
+
<dd>{facts.legalName}</dd>
|
|
42
|
+
{facts.serviceAreas.length > 0 && (
|
|
43
|
+
<>
|
|
44
|
+
<dt>Areas served</dt>
|
|
45
|
+
<dd>{facts.serviceAreas.join(", ")}</dd>
|
|
46
|
+
</>
|
|
47
|
+
)}
|
|
48
|
+
<dt>Website</dt>
|
|
49
|
+
<dd>{facts.url}</dd>
|
|
50
|
+
</dl>
|
|
51
|
+
</section>
|
|
52
|
+
|
|
53
|
+
{accreditations.length > 0 && (
|
|
54
|
+
<section>
|
|
55
|
+
<h2>Accreditations</h2>
|
|
56
|
+
<ul>
|
|
57
|
+
{accreditations.map((a) => (
|
|
58
|
+
<li key={a.name}>
|
|
59
|
+
<a href={a.registerUrl ?? undefined}>{a.name}</a>
|
|
60
|
+
</li>
|
|
61
|
+
))}
|
|
62
|
+
</ul>
|
|
63
|
+
</section>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{(facts.email || facts.phone) && (
|
|
67
|
+
<section>
|
|
68
|
+
<h2>Press contact</h2>
|
|
69
|
+
{facts.email && (
|
|
70
|
+
<p>
|
|
71
|
+
<a href={`mailto:${facts.email}`}>{facts.email}</a>
|
|
72
|
+
</p>
|
|
73
|
+
)}
|
|
74
|
+
{facts.phone && (
|
|
75
|
+
<p>
|
|
76
|
+
<a href={`tel:${facts.phone.replace(/\s+/g, "")}`}>{facts.phone}</a>
|
|
77
|
+
</p>
|
|
78
|
+
)}
|
|
79
|
+
</section>
|
|
80
|
+
)}
|
|
81
|
+
|
|
82
|
+
{coverage.length > 0 && (
|
|
83
|
+
<section>
|
|
84
|
+
<h2>Coverage</h2>
|
|
85
|
+
<ul>
|
|
86
|
+
{coverage.map((c) => (
|
|
87
|
+
<li key={c.url}>
|
|
88
|
+
<a href={c.url}>{c.source}</a>
|
|
89
|
+
</li>
|
|
90
|
+
))}
|
|
91
|
+
</ul>
|
|
92
|
+
</section>
|
|
93
|
+
)}
|
|
94
|
+
</main>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
// The home for the site's linkable assets: a cost guide from the client's own
|
|
2
|
-
// job data, a calculator, or a practical guide. Kept out of the index until
|
|
3
|
-
// the first one ships: flip /resources to indexable in site.routes.ts then.
|
|
4
|
-
// Written by @domandigital/create-site.
|
|
5
|
-
|
|
6
|
-
import type { Metadata } from "next";
|
|
7
|
-
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
-
import { facts } from "~site/facts";
|
|
9
|
-
import { linkableAssets, policy } from "~site/routes";
|
|
10
|
-
|
|
11
|
-
export const metadata: Metadata = {
|
|
12
|
-
title: `Resources: ${facts.tradingName}`,
|
|
13
|
-
robots: { index: isRouteIndexable(policy, "/resources") },
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default function ResourcesPage() {
|
|
17
|
-
return (
|
|
18
|
-
<main>
|
|
19
|
-
<h1>Resources</h1>
|
|
20
|
-
{linkableAssets.length > 0 && (
|
|
21
|
-
<ul>
|
|
22
|
-
{linkableAssets.map((asset) => (
|
|
23
|
-
<li key={asset.path}>
|
|
24
|
-
<a href={asset.path}>{asset.title}</a>
|
|
25
|
-
<p>{asset.summary}</p>
|
|
26
|
-
</li>
|
|
27
|
-
))}
|
|
28
|
-
</ul>
|
|
29
|
-
)}
|
|
30
|
-
</main>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
1
|
+
// The home for the site's linkable assets: a cost guide from the client's own
|
|
2
|
+
// job data, a calculator, or a practical guide. Kept out of the index until
|
|
3
|
+
// the first one ships: flip /resources to indexable in site.routes.ts then.
|
|
4
|
+
// Written by @domandigital/create-site.
|
|
5
|
+
|
|
6
|
+
import type { Metadata } from "next";
|
|
7
|
+
import { isRouteIndexable } from "@domandigital/seo";
|
|
8
|
+
import { facts } from "~site/facts";
|
|
9
|
+
import { linkableAssets, policy } from "~site/routes";
|
|
10
|
+
|
|
11
|
+
export const metadata: Metadata = {
|
|
12
|
+
title: `Resources: ${facts.tradingName}`,
|
|
13
|
+
robots: { index: isRouteIndexable(policy, "/resources") },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default function ResourcesPage() {
|
|
17
|
+
return (
|
|
18
|
+
<main>
|
|
19
|
+
<h1>Resources</h1>
|
|
20
|
+
{linkableAssets.length > 0 && (
|
|
21
|
+
<ul>
|
|
22
|
+
{linkableAssets.map((asset) => (
|
|
23
|
+
<li key={asset.path}>
|
|
24
|
+
<a href={asset.path}>{asset.title}</a>
|
|
25
|
+
<p>{asset.summary}</p>
|
|
26
|
+
</li>
|
|
27
|
+
))}
|
|
28
|
+
</ul>
|
|
29
|
+
)}
|
|
30
|
+
</main>
|
|
31
|
+
);
|
|
32
|
+
}
|