Skip to content

Commit 064bd6a

Browse files
ferr079claude
andcommitted
feat: replace build-time commit/journal fetch with DynNum on about
Remove SSR Forgejo API calls from about frontmatter. All track record stats now sourced from kv-push.sh → KV → DynNum (single source of truth). New KV stats: forgejo_commits_total (x-total-count), journal_entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1cb3018 commit 064bd6a

2 files changed

Lines changed: 8 additions & 44 deletions

File tree

src/pages/about.astro

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,7 @@
22
import Base from '../layouts/Base.astro';
33
import DynNum from '../components/DynNum.astro';
44
5-
// Forgejo — fetch commit counts at build time
6-
const forgejoRepos = ['homelab-infra', 'homelab-configs', 'ansible-homelab', 'pixelium-site'];
7-
let totalCommits = 278;
8-
let journalEntries = 67;
9-
try {
10-
const base = 'https://forgejo.pixelium.internal/api/v1';
11-
const headers = { 'Authorization': `token ${import.meta.env.FORGEJO_TOKEN}` };
12-
const fetchOpts = { headers, ...(typeof process !== 'undefined' ? { agent: undefined } : {}) };
13-
const counts = await Promise.all(forgejoRepos.map(async (repo) => {
14-
const res = await fetch(`${base}/repos/uzer/${repo}/commits?limit=1`, { headers });
15-
return parseInt(res.headers.get('x-total-count') || '0');
16-
}));
17-
totalCommits = counts.reduce((a, b) => a + b, 0);
18-
// Count journal entries from latest file
19-
const journalRes = await fetch(`${base}/repos/uzer/homelab-infra/raw/journal/2026-03.md`, { headers });
20-
if (journalRes.ok) {
21-
const text = await journalRes.text();
22-
journalEntries = (text.match(/^### /gm) || []).length;
23-
}
24-
} catch (_) {}
5+
// Commits and journal entries are now dynamic via DynNum (fed by kv-push.sh → KV)
256
267
const skills = [
278
{
@@ -89,11 +70,11 @@ const skills = [
8970
<p>Real numbers from our infrastructure &mdash; not estimates, not goals. Every number below is verifiable in git history, ops journal, or live systems.</p>
9071
<div class="track-grid">
9172
<div class="track-stat">
92-
<span class="track-number">{totalCommits}+</span>
93-
<span class="track-label">commits across 4 repos</span>
73+
<span class="track-number"><DynNum stat="forgejo_commits_total" fallback="350+" suffix="+" /></span>
74+
<span class="track-label">commits across repos</span>
9475
</div>
9576
<div class="track-stat">
96-
<span class="track-number">{journalEntries}</span>
77+
<span class="track-number"><DynNum stat="journal_entries" fallback="70+" suffix="+" /></span>
9778
<span class="track-label">ops journal entries</span>
9879
</div>
9980
<div class="track-stat">

src/pages/fr/about.astro

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,7 @@
22
import Base from '../../layouts/Base.astro';
33
import DynNum from '../../components/DynNum.astro';
44
5-
// Forgejo — fetch commit counts at build time
6-
const forgejoRepos = ['homelab-infra', 'homelab-configs', 'ansible-homelab', 'pixelium-site'];
7-
let totalCommits = 278;
8-
let journalEntries = 67;
9-
try {
10-
const base = 'https://forgejo.pixelium.internal/api/v1';
11-
const headers = { 'Authorization': `token ${import.meta.env.FORGEJO_TOKEN}` };
12-
const counts = await Promise.all(forgejoRepos.map(async (repo) => {
13-
const res = await fetch(`${base}/repos/uzer/${repo}/commits?limit=1`, { headers });
14-
return parseInt(res.headers.get('x-total-count') || '0');
15-
}));
16-
totalCommits = counts.reduce((a, b) => a + b, 0);
17-
const journalRes = await fetch(`${base}/repos/uzer/homelab-infra/raw/journal/2026-03.md`, { headers });
18-
if (journalRes.ok) {
19-
const text = await journalRes.text();
20-
journalEntries = (text.match(/^### /gm) || []).length;
21-
}
22-
} catch (_) {}
5+
// Commits and journal entries are now dynamic via DynNum (fed by kv-push.sh → KV)
236
247
const skills = [
258
{
@@ -87,11 +70,11 @@ const skills = [
8770
<p>Des chiffres réels de notre infrastructure — pas des estimations, pas des objectifs. Chaque nombre ci-dessous est vérifiable dans l'historique git, le journal ops, ou les systèmes live.</p>
8871
<div class="track-grid">
8972
<div class="track-stat">
90-
<span class="track-number">{totalCommits}+</span>
91-
<span class="track-label">commits sur 4 repos</span>
73+
<span class="track-number"><DynNum stat="forgejo_commits_total" fallback="350+" suffix="+" /></span>
74+
<span class="track-label">commits sur les repos</span>
9275
</div>
9376
<div class="track-stat">
94-
<span class="track-number">{journalEntries}</span>
77+
<span class="track-number"><DynNum stat="journal_entries" fallback="70+" suffix="+" /></span>
9578
<span class="track-label">entrées journal ops</span>
9679
</div>
9780
<div class="track-stat">

0 commit comments

Comments
 (0)