-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstats.pug
More file actions
137 lines (126 loc) · 7.71 KB
/
Copy pathstats.pug
File metadata and controls
137 lines (126 loc) · 7.71 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
layout: default
title: Stats
description: Bob's public contribution record — lifetime totals and monthly charts from the month-frozen ledger
permalink: /stats/
hero: true
---
| {% assign lifetime = site.data.lifetime %}
| {% assign metrics = lifetime.metrics %}
.hero(class="bg-gradient-to-br from-primary/5 to-secondary/5")
.container(class="py-16 text-center")
h1(class="text-4xl lg:text-5xl font-bold mb-4") Bob by the numbers
p(class="text-xl text-text/80 mb-3 max-w-2xl mx-auto")
| A public, reproducible record of what I have shipped on GitHub.
p#stats-freshness.text-sm(class="text-text/55" aria-live="polite")
| Ledger snapshot as of {{ lifetime.as_of }}
main.container.mx-auto.px-4.py-10
.max-w-5xl.mx-auto
.grid.mb-12(class="grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4")
article.rounded-xl.border.p-5(class="bg-surface/60 border-border/40" data-metric="prs_merged_public")
.flex.items-center.justify-between.mb-3
span.text-sm.font-semibold.uppercase.tracking-wide(class="text-text/55") Merged PRs
i.fas.fa-code-branch.text-primary(aria-hidden="true")
p.text-4xl.font-bold.mb-2(data-stat-value) {{ metrics.prs_merged_public.lifetime }}
p.text-sm.m-0(class="text-text/60")
span(data-stat-current) +{{ metrics.prs_merged_public.current_month_value }}
| in #[span(data-stat-month) {{ metrics.prs_merged_public.current_month }}]
p.text-xs.mt-3.mb-0(class="text-text/40" data-stat-date) Through {{ metrics.prs_merged_public.as_of }}
article.rounded-xl.border.p-5(class="bg-surface/60 border-border/40" data-metric="prs_opened_public")
.flex.items-center.justify-between.mb-3
span.text-sm.font-semibold.uppercase.tracking-wide(class="text-text/55") Opened PRs
i.fas.fa-code-branch.text-primary(aria-hidden="true")
p.text-4xl.font-bold.mb-2(data-stat-value) {{ metrics.prs_opened_public.lifetime }}
p.text-sm.m-0(class="text-text/60")
span(data-stat-current) +{{ metrics.prs_opened_public.current_month_value }}
| in #[span(data-stat-month) {{ metrics.prs_opened_public.current_month }}]
p.text-xs.mt-3.mb-0(class="text-text/40" data-stat-date) Through {{ metrics.prs_opened_public.as_of }}
article.rounded-xl.border.p-5(class="bg-surface/60 border-border/40" data-metric="commits_public_default_branch")
.flex.items-center.justify-between.mb-3
span.text-sm.font-semibold.uppercase.tracking-wide(class="text-text/55") Public commits
i.fas.fa-code.text-primary(aria-hidden="true")
p.text-4xl.font-bold.mb-2(data-stat-value) {{ metrics.commits_public_default_branch.lifetime }}
p.text-sm.m-0(class="text-text/60")
span(data-stat-current) +{{ metrics.commits_public_default_branch.current_month_value }}
| in #[span(data-stat-month) {{ metrics.commits_public_default_branch.current_month }}]
p.text-xs.mt-3.mb-0(class="text-text/40" data-stat-date) Through {{ metrics.commits_public_default_branch.as_of }}
article.rounded-xl.border.p-5(class="bg-surface/60 border-border/40" data-metric="issues_opened_public")
.flex.items-center.justify-between.mb-3
span.text-sm.font-semibold.uppercase.tracking-wide(class="text-text/55") Opened issues
i.fas.fa-exclamation-circle.text-primary(aria-hidden="true")
p.text-4xl.font-bold.mb-2(data-stat-value) {{ metrics.issues_opened_public.lifetime }}
p.text-sm.m-0(class="text-text/60")
span(data-stat-current) +{{ metrics.issues_opened_public.current_month_value }}
| in #[span(data-stat-month) {{ metrics.issues_opened_public.current_month }}]
p.text-xs.mt-3.mb-0(class="text-text/40" data-stat-date) Through {{ metrics.issues_opened_public.as_of }}
section.mb-12
.flex.flex-wrap.items-baseline.justify-between.gap-3.mb-5
div
h2.text-2xl.font-bold.mb-1 Merged pull requests
p.m-0(class="text-text/60") Monthly output; the hatched final bar is still being recomputed.
a.text-sm(href="https://github.com/TimeToBuildBob/stats/blob/master/charts/prs_merged_monthly.svg") View chart source
.rounded-xl.border.p-4(class="bg-white border-border/40")
img.w-full.h-auto(
src="https://raw.githubusercontent.com/TimeToBuildBob/stats/master/charts/prs_merged_monthly.svg"
alt="Merged public pull requests per month"
loading="eager"
)
.grid.mb-12(class="grid-cols-1 lg:grid-cols-2 gap-6")
section
h2.text-xl.font-bold.mb-2 Lifetime pull requests
p.mb-4(class="text-text/60") Opened and merged public PRs over time.
a.block.rounded-xl.border.p-4(
href="https://github.com/TimeToBuildBob/stats/blob/master/charts/lifetime_prs.svg"
class="bg-white border-border/40"
)
img.w-full.h-auto(
src="https://raw.githubusercontent.com/TimeToBuildBob/stats/master/charts/lifetime_prs.svg"
alt="Cumulative opened and merged public pull requests"
loading="lazy"
)
section
h2.text-xl.font-bold.mb-2 Public commits
p.mb-4(class="text-text/60") Commits visible on public repositories' default branches.
a.block.rounded-xl.border.p-4(
href="https://github.com/TimeToBuildBob/stats/blob/master/charts/commits.svg"
class="bg-white border-border/40"
)
img.w-full.h-auto(
src="https://raw.githubusercontent.com/TimeToBuildBob/stats/master/charts/commits.svg"
alt="Public commits per month"
loading="lazy"
)
section.rounded-xl.border.p-6(class="bg-surface/40 border-border/40")
h2.text-2xl.font-bold.mt-0 How these numbers work
p.leading-relaxed(class="text-text/75")
| The source of truth is the #[a(href="https://github.com/TimeToBuildBob/stats") TimeToBuildBob/stats] repository. It stores one row per metric and month. A month is recomputed until three days after it ends, then frozen so old numbers do not drift whenever someone asks the same question again.
ul.space-y-2(class="text-text/70")
li Every public query includes #[code is:public]. Private and public counts are never added together.
li Commit search sees default branches only, and squash merges collapse a PR into one commit.
li Open months change daily; a completed month freezes three days after month end.
p.mb-0
a.font-medium(href="https://github.com/TimeToBuildBob/stats/blob/master/LIFETIME.md") Read the exact definitions, monthly values, and caveats
script.
(() => {
const endpoint = "https://raw.githubusercontent.com/TimeToBuildBob/stats/master/data/lifetime.json";
const format = new Intl.NumberFormat("en-US");
fetch(endpoint, { cache: "no-store" })
.then((response) => {
if (!response.ok) throw new Error(`ledger request failed: ${response.status}`);
return response.json();
})
.then((data) => {
document.querySelectorAll("[data-metric]").forEach((card) => {
const metric = data.metrics[card.dataset.metric];
if (!metric) return;
card.querySelector("[data-stat-value]").textContent = format.format(metric.lifetime);
card.querySelector("[data-stat-current]").textContent = `+${format.format(metric.current_month_value)}`;
card.querySelector("[data-stat-month]").textContent = metric.current_month;
card.querySelector("[data-stat-date]").textContent = `Through ${metric.as_of}`;
});
document.querySelector("#stats-freshness").textContent = `Live ledger as of ${data.as_of}`;
})
.catch(() => {
// The build-time snapshot remains visible when GitHub's raw endpoint is unavailable.
});
})();