Last Updated Feature
Rspress has a built-in "Last Updated" feature that displays the last modification time of the document based on Git history.
Configuration Method
Add lastUpdated configuration in themeConfig of rspress.config.ts:
Configuration Options
Display Effect
When enabled, the last updated time will be displayed at the bottom of each document page in the format:
How It Works
Rspress uses Git to get the last commit time of the current document file. This means:
- The repository must be a Git repository
- The file must be tracked by Git
- The build environment must have Git installed
Usage Examples
Example 1: Enable Last Updated Display
Example 2: Disable Last Updated Display
Notes
- The last updated time is based on Git commit history, not file system modification time
- If the file is not tracked by Git, the last updated time will not be displayed
- In CI/CD environments, make sure Git is installed and the repository is properly cloned with commit history