Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ export default extendConfig(
description:
"Self-host Plane, integrate with our API, configure webhooks, and extend your project management platform. Complete guides for developers building on Plane.",

// SEO: Per-page lastmod in sitemap.xml from each file's latest git commit.
// Requires full git history at build time (see package.json build script).
lastUpdated: true,

// SEO: Generate sitemap automatically
sitemap: {
hostname: "https://developers.plane.so",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"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.

"preview": "vitepress preview docs",
"fix:format": "prettier --write .",
"check:format": "prettier --check .",
Expand Down
Loading