Added auto-generated "Updated..." line under H1 (#719)

This commit is contained in:
Brandon Hopkins
2026-05-04 09:37:57 -07:00
committed by GitHub
parent 6645bc1068
commit 28b7c13bd3
6 changed files with 144 additions and 4 deletions

18
scripts/git-dates.mjs Normal file
View File

@@ -0,0 +1,18 @@
import { execSync } from 'child_process'
/**
* Get the last modified date for a file from git history.
* Returns YYYY-MM-DD or null if the file is not tracked / git is unavailable.
*/
export function getGitLastModified(filePath) {
try {
const date = execSync(`git log -1 --format=%cI -- "${filePath}"`, {
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'ignore'],
}).trim()
return date ? date.split('T')[0] : null
} catch {
return null
}
}