Skip to content

fix: fetch full git history for last-modified timestamps#2998

Merged
bartlomieju merged 1 commit intomainfrom
fix/last-modified-shallow-clone
Mar 27, 2026
Merged

fix: fetch full git history for last-modified timestamps#2998
bartlomieju merged 1 commit intomainfrom
fix/last-modified-shallow-clone

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju commented Mar 27, 2026

Summary

  • The "Last modified" feature from feat: add last modified timestamp to content pages #2982 doesn't work on the deployed site because Deno Deploy's GitHub integration does a shallow clone — git log returns almost nothing
  • Fix: pre-generate lastModified.json from full git history as a separate build step, commit it to the repo, and have the Lume preprocessor read from it instead of spawning git
  • CI auto-updates lastModified.json on each push to main (with [skip ci] to avoid loops)

Changes

  • scripts/generate_last_modified.ts — standalone script that runs git log and writes the JSON map
  • _config.ts — preprocessor reads from JSON file instead of running git; warns gracefully if file missing
  • deno.json — new generate:last-modified task, added to build and build:light
  • .github/workflows/lint.yml — generates JSON before build; commits updated JSON on main pushes
  • lastModified.json — initial generated data (2375 entries)

Test plan

  • CI build passes
  • Deploy preview shows "Last updated on ..." on content pages (e.g. /runtime/fundamentals/typescript/)

🤖 Generated with Claude Code

The checkout step defaults to fetch-depth: 1 (shallow clone), which
means `git log` in the Lume preprocessor only sees one commit and
almost no files get a lastModified date. Use fetch-depth: 0 to get
full history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bartlomieju bartlomieju merged commit 62f854b into main Mar 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants