Skip to content

fix: store last-modified dates in frontmatter#3002

Merged
bartlomieju merged 5 commits intomainfrom
fix/last-modified-deploy
Mar 30, 2026
Merged

fix: store last-modified dates in frontmatter#3002
bartlomieju merged 5 commits intomainfrom
fix/last-modified-deploy

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 Deploy because shallow clones break git log
  • Instead of generating dates at build time, store last_modified: YYYY-MM-DD directly in each page's frontmatter
  • Self-documenting, works everywhere (Deploy, shallow clones, forks), and enables a CI lint to enforce date updates on content PRs

Changes

  • Add last_modified frontmatter to 219 .md files across runtime/, deploy/, and examples/tutorials/ (dates populated from git history)
  • Simplify _config.ts preprocessor to read lastModified from frontmatter
  • Remove lastModified.json
  • Revert .github/workflows/lint.yml changes

Test plan

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

🤖 Generated with Claude Code

bartlomieju and others added 3 commits March 27, 2026 15:17
Deno Deploy's GitHub integration does a shallow clone, so the
`git log` approach from #2982 produces no data at deploy time.

Instead, generate lastModified.json from git history as a build step
and commit it via CI. The Lume preprocessor now reads from this JSON
file instead of spawning git.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the git log + JSON fallback logic into the Lume preprocessor
in _config.ts. With full git history (local dev, CI with fetch-depth:0)
it generates dates from git and persists lastModified.json. On shallow
clones (Deno Deploy) it falls back to the committed JSON file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/lint.yml
Comment thread _config.ts Outdated
Comment thread lastModified.json Outdated
Move last-modified dates into each page's frontmatter rather than
generating from git history or a JSON file. This is self-documenting,
works on any environment (Deploy, shallow clones, forks), and enables
a future lint to enforce date updates on content PRs.

- Add `last_modified: YYYY-MM-DD` to 219 .md files in runtime/, deploy/,
  and examples/tutorials/ (populated from git history)
- Simplify _config.ts preprocessor to just read from frontmatter
- Remove lastModified.json
- Revert .github/workflows/lint.yml changes
- Add scripts/populate_last_modified.ts migration script

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bartlomieju bartlomieju changed the title fix: pre-generate lastModified.json for Deno Deploy fix: store last-modified dates in frontmatter Mar 29, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bartlomieju bartlomieju requested a review from crowlKats March 29, 2026 17:28
@bartlomieju bartlomieju merged commit 2fed5bc into main Mar 30, 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