Skip to content

Feat: Enable per-page git timestamps for sitemap lastmod and footer updates#298

Merged
srinivaspendem merged 1 commit into
masterfrom
sitemap-lastmod
Jul 13, 2026
Merged

Feat: Enable per-page git timestamps for sitemap lastmod and footer updates#298
srinivaspendem merged 1 commit into
masterfrom
sitemap-lastmod

Conversation

@srinivaspendem

@srinivaspendem srinivaspendem commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation

    • Added last-updated timestamps to documentation pages, improving freshness visibility and SEO metadata.
  • Chores

    • Updated the documentation build process to retrieve complete repository history when available, supporting accurate page metadata generation.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
developer-docs Ready Ready Preview, Comment Jul 13, 2026 11:30am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The documentation build now attempts to fetch complete Git history before running VitePress, and VitePress enables per-page last-updated timestamps in its SEO configuration.

Changes

VitePress build metadata

Layer / File(s) Summary
Build history and update metadata
package.json, docs/.vitepress/config.mts
The build script attempts git fetch --unshallow before building, and VitePress enables lastUpdated metadata for generated pages.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enabling per-page git timestamps for VitePress SEO metadata and related updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sitemap-lastmod

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 8: Update the package.json build script to avoid silently continuing
after a failed git unshallow fetch: either propagate the fetch failure so the
build stops with shallow history, or explicitly disable VitePress lastUpdated
and sitemap lastmod values when the fallback is used.
- Line 8: Update the package.json build script’s failed git fetch fallback to
use a Node-based no-op command instead of `true`, ensuring the subsequent
`vitepress build docs` runs consistently across Windows and Unix shells.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5e093210-d1fd-4dbd-adb9-8a5946b11351

📥 Commits

Reviewing files that changed from the base of the PR and between faebb73 and 50d2295.

📒 Files selected for processing (2)
  • docs/.vitepress/config.mts
  • package.json

Comment thread package.json
"scripts": {
"dev": "vitepress dev docs",
"build": "vitepress build docs",
"build": "(git fetch --unshallow || true) && vitepress build docs",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## package.json\n'
cat -n package.json | sed -n '1,120p'

printf '\n## docs/.vitepress/config.mts\n'
cat -n docs/.vitepress/config.mts | sed -n '1,260p'

printf '\n## Search for lastmod / git history references\n'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' 'lastmod|git fetch --unshallow|unshallow|git history|last-modified|lastModified' .

Repository: makeplane/developer-docs

Length of output: 15537


🌐 Web query:

VitePress lastUpdated sitemap git history shallow clone build behavior

💡 Result:

In VitePress, the lastUpdated feature and sitemap generation rely on Git commit history to determine the timestamp of files [1][2]. When a build environment performs a shallow clone (which is the default in many CI/CD services like GitHub Actions, Netlify, or Cloudflare Pages), only the most recent commit is typically available [3][4][1]. Impact of Shallow Clone: Because VitePress internally executes git log -1 --pretty="%at" on each file to retrieve its timestamp [1][5], a shallow clone limits the history available to Git [3][1]. Consequently, if the history is insufficient to identify the actual last modification commit for each individual file, many or all pages may incorrectly display the same timestamp (often the date of the most recent commit in the repository) [3][4][1]. Resolution for CI/CD Builds: To ensure accurate timestamps for lastUpdated and sitemap generation, you must configure your CI/CD environment to fetch the full Git history: 1. GitHub Actions: Update your checkout step to include fetch-depth: 0 [1][6]. - name: Checkout uses: actions/checkout@v5 with: fetch-depth: 0 2. Other CI/CD Environments: If your provider does not support configuring the clone depth, you can prepend the build command in your package.json with a manual fetch to unshallow the repository [4][1]: "docs:build": "git fetch --unshallow && vitepress build docs" Sitemap Behavior: VitePress uses the lastUpdated timestamp for the sitemap's lastmod attribute [7][2]. As of recent updates, VitePress respects any custom lastUpdated value defined in a file's frontmatter; if that is absent, it falls back to the timestamp retrieved from the Git log [8][2][9]. Ensuring a full Git history as described above is necessary for the sitemap's lastmod values to reflect the true historical modification dates of your files [1][2].

Citations:


Don’t ignore a failed unshallow fetch at package.json:8|| true leaves the build running with shallow history, so VitePress can publish incorrect lastUpdated/sitemap lastmod values. Make the build fail if history stays shallow, or explicitly disable those timestamps in that fallback path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 8, Update the package.json build script to avoid
silently continuing after a failed git unshallow fetch: either propagate the
fetch failure so the build stops with shallow history, or explicitly disable
VitePress lastUpdated and sitemap lastmod values when the fallback is used.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- package.json ---\n'
cat -n package.json | sed -n '1,80p'

printf '\n--- search for build script usage / Windows hints ---\n'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' --glob '!coverage' '"build"|vitepress build docs|git fetch --unshallow|cmd\.exe|Windows|cross-platform' .

printf '\n--- git-related package manager hints ---\n'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' --glob '!coverage' '^packageManager|engines|scripts' package.json .npmrc .yarnrc* .pnpmfile* 2>/dev/null || true

Repository: makeplane/developer-docs

Length of output: 253


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- package.json ---'
cat -n package.json | sed -n '1,120p'

echo
echo '--- search for build script usage / Windows hints ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' --glob '!coverage' '"build"|vitepress build docs|git fetch --unshallow|cmd\.exe|Windows|cross-platform' .

echo
echo '--- git-related package manager hints ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' --glob '!coverage' '^packageManager|engines|scripts' package.json .npmrc .yarnrc* .pnpmfile* 2>/dev/null || true

Repository: makeplane/developer-docs

Length of output: 4342


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- top-level files ---'
git ls-files | sed -n '1,120p'

echo
echo '--- README / docs mentioning setup or supported OS ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' --glob '!coverage' -i 'windows|wsl|git bash|macos|linux|install|setup|pnpm|npm run build|package manager|prerequisite|supported os' README* docs package.json .github 2>/dev/null || true

echo
echo '--- package manager docs in root ---'
fd -a 'README*|CONTRIBUTING*|INSTALL*|SETUP*' .

Repository: makeplane/developer-docs

Length of output: 50381


package.json:8 — Keep the build preflight cross-platform.
true isn’t available in Windows package-script shells, so a failed git fetch --unshallow stops pnpm build before vitepress build docs runs. Use a Node-based no-op fallback instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 8, Update the package.json build script’s failed git
fetch fallback to use a Node-based no-op command instead of `true`, ensuring the
subsequent `vitepress build docs` runs consistently across Windows and Unix
shells.

@srinivaspendem srinivaspendem merged commit 3d38671 into master Jul 13, 2026
8 checks passed
@srinivaspendem srinivaspendem deleted the sitemap-lastmod branch July 13, 2026 11:36
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