Repository navigation
Expand file tree
/
Copy pathmeta.js
More file actions
56 lines (50 loc) · 2.6 KB
/
Copy pathmeta.js
File metadata and controls
56 lines (50 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import lighthousePackage from "lighthouse/package.json" with { type: "json" };
function goatcounterUrl(value) {
if (!value) return "";
let url;
try {
url = new URL(value);
} catch {
throw new Error(`SPEEDLIFY_GOATCOUNTER_URL is not a valid URL: ${JSON.stringify(value)}`);
}
if (url.protocol !== "https:") {
throw new Error(`SPEEDLIFY_GOATCOUNTER_URL must be an https:// URL: ${JSON.stringify(value)}`);
}
return url.href;
}
export default {
title: "speedlify2",
tagline: "Web performance, measured over time",
description:
"Lighthouse lab metrics, Axe, and Chrome UX Report field data for a list of sites recorded and compared over time.",
// Set to your deployed origin for absolute URLs in metadata.
// Where this instance is published. Used for the copy-paste embed snippets,
// which land on other people's sites and so need an absolute URL — a path
// would resolve against their domain. No trailing slash: the templates add
// one, and two would give //js/speedlify2-score.js.
url: process.env.SPEEDLIFY_SITE_URL || "https://www.speedlify.dev",
// Where the source lives, linked from the footer. Defaulted rather than left
// blank: an empty string silently drops the link, which is how the header one
// went unnoticed for so long. Override it when running your own instance.
repo: process.env.SPEEDLIFY_REPO_URL || "https://github.com/zachleat/speedlify2",
// The installed Lighthouse, which is what measures the next run.
lighthouseVersion: lighthousePackage.version,
// GoatCounter endpoint, e.g. https://you.goatcounter.com/count. Off unless
// set: analytics belong to one deployment, not to the template.
goatcounter: goatcounterUrl(process.env.SPEEDLIFY_GOATCOUNTER_URL),
// Favicon service for the site list. `{url}` is replaced with the
// encoded site URL. Set to "" for a build that makes no external requests
// at all — which is arguably the right default for a tool that measures
// third-party weight for a living.
avatarService: "https://v1.indieweb-avatar.11ty.dev/{url}/",
// Screenshot service for the individual site pages. Same substitution, same
// switch: "" turns it off. `medium` is 650px wide at the service's default
// 1:1 ratio; the sizes it offers are small (375), medium (650), large (1024)
// and opengraph (1200x630).
//
// One request per site page rather than per row, which is why this is on the
// detail pages and not the leaderboard — a category page carries a thousand
// rows, and a thousand screenshots is not a page, it is a denial of service
// aimed at someone else's server.
screenshotService: "https://v1.screenshot.11ty.dev/{url}/medium/",
};