Skip to content

feat: add last modified timestamp to content pages#2982

Merged
bartlomieju merged 1 commit intomainfrom
feat/last-modified-timestamp
Mar 26, 2026
Merged

feat: add last modified timestamp to content pages#2982
bartlomieju merged 1 commit intomainfrom
feat/last-modified-timestamp

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Adds a "Last updated on " timestamp to documentation pages, using git history as the source of truth
  • Runs a single git log command (~150ms) via Deno.spawnAndWaitSync() during Lume preprocessing to build a file→date map — avoids the per-file git log cost of Lume's built-in "Git Last Modified"
  • Displays the date above the feedback section on content pages; skips API reference and lint rule pages (auto-generated)

Closes #1280

Test plan

  • deno task build:light succeeds
  • Verified <time> element with correct date appears in built HTML
  • Visual check on deployed preview

🤖 Generated with Claude Code

Uses a single `git log` command via `Deno.spawnAndWaitSync()` during
Lume preprocessing to build a file-to-date map, then displays
"Last updated on <date>" above the feedback section. Skips API
reference and lint rule pages. Closes #1280.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bartlomieju bartlomieju merged commit ce49bca into main Mar 26, 2026
2 checks passed
bartlomieju added a commit that referenced this pull request Mar 27, 2026
- The `actions/checkout@v4` defaults to `fetch-depth: 1` (shallow clone), so the `git log` command added in #2982 only sees a single commit and almost no files get a `lastModified` date
- Adding `fetch-depth: 0` gives the preprocessor full git history to build the file→date map

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bartlomieju added a commit that referenced this pull request Mar 27, 2026
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>
bartlomieju added a commit that referenced this pull request Mar 27, 2026
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>
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.

Add last modified timestmp to content pages in docs

2 participants