Build stamp, live listening strip, OG cards, closer shiki ground
- footer: 'built <ts> · <hash> · <n> notes', hash linking to Gitea (GARDEN_COMMIT passed in by build.sh; '+' marks dirty-tree builds) - homepage header: live strip fed by api.c0smere.net/spotify/summary (weekly aggregate + monthly top artist/genre), fail-closed like the odometer and header quote - /og/<slug>.png satori+resvg cards for every note + the homepage; og:/twitter: meta in Base - shiki github-dark-default (#0d1117 sits closer to the page ground) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// Build provenance for the footer stamp. Evaluated once per build (module
|
||||
// scope). The containerized build has no git binary, so deploy/build.sh
|
||||
// passes GARDEN_COMMIT in; local builds fall back to asking git directly.
|
||||
// A trailing "+" marks a build from a dirty tree.
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
function detectCommit() {
|
||||
if (process.env.GARDEN_COMMIT) return process.env.GARDEN_COMMIT;
|
||||
try {
|
||||
const h = execSync('git rev-parse --short HEAD', {
|
||||
stdio: ['ignore', 'pipe', 'ignore'],
|
||||
})
|
||||
.toString()
|
||||
.trim();
|
||||
let dirty = '';
|
||||
try {
|
||||
execSync('git diff --quiet', { stdio: 'ignore' });
|
||||
} catch {
|
||||
dirty = '+';
|
||||
}
|
||||
return h + dirty;
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
export const COMMIT = detectCommit();
|
||||
|
||||
const fmt = new Intl.DateTimeFormat('en-CA', {
|
||||
dateStyle: 'short',
|
||||
timeStyle: 'short',
|
||||
hour12: false,
|
||||
timeZone: 'America/New_York',
|
||||
});
|
||||
export const BUILT_AT = fmt.format(new Date()).replace(', ', ' ');
|
||||
Reference in New Issue
Block a user