morningman opened a new pull request, #4004:
URL: https://github.com/apache/doris-website/pull/4004

   ## What
   
   Adds a **"Last updated"** date to documentation page footers, sourced from 
each file's most recent git commit. Shown on **Dev**, **4.x** (latest stable), 
and **community** docs; older versions (3.x, 2.1) intentionally don't display 
it (their dates would look stale).
   
   ## How it works
   
   The 2-hourly Cron Deploy uses a shallow clone, so it can't derive per-file 
git dates directly. Instead:
   
   1. **`scripts/last-update/generate.js`** walks the full git history in a 
single pass and writes **`scripts/last-update/data.json`** (`repo-relative path 
→ ISO commit date`), covering en + zh-CN for the built versions (dev, 4.x, 3.x, 
2.1) and community.
   2. **`docusaurus.config.js`** loads that map and injects it as `last_update` 
front matter via `markdown.parseFrontMatter`, and enables `showLastUpdateTime`. 
Because Docusaurus prefers front-matter dates over git, the deploy renders 
dates **without calling git** — no build-time regression, no full-history 
clone, and the existing deploy workflow is unchanged.
   3. **`src/theme/DocItem/Footer`** gates *display* to Dev + latest-stable 
(4.x) + community.
   
   ## Refreshing the timestamps
   
   - **Manually via GitHub Actions:** run the **Refresh Docs Last-Update Map** 
workflow (`.github/workflows/refresh-docs-last-update.yml`). It does a blobless 
full-history checkout, regenerates the map, and opens a PR.
     - ⚠️ Requires the repo/org setting **"Allow GitHub Actions to create and 
approve pull requests"** to be enabled.
   - **Locally (macOS/Linux):** `yarn last-update:refresh` (or 
`./scripts/last-update/refresh-last-update.sh`). Needs a full (non-shallow) 
clone; it fails loudly on a shallow one.
   
   ## Verification
   
   Built locally (en; versions dev/4.x/2.1 + community):
   
   | Area | Pages showing "Last updated" |
   |------|------------------------------|
   | Dev | 1588 |
   | 4.x | 1586 |
   | community | 47 |
   | 2.1 | 0 (correctly gated off) |
   
   Rendered dates match `git log` exactly (e.g. `docs/install/intro.mdx` → May 
17, 2026), emitted with `itemprop=dateModified` for SEO.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01YMwVSBQkR4mbJPVbEqnCUR
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to