PageLastCommit
PageLastCommit is already mounted in the meta row below the lead of every docs page, next to the source and copy page links; you never add it in Markdown. It shows:
- Updated at: the time of the file's latest commit, formatted with
github.dateFormat - Author: the committer's GitHub username and avatar, linking to their profile
- Message: the first line of the commit message, linking to the commit
When it appears
Like CommitChangelog, it needs a working GitHub integration and NUXT_GITHUB_TOKEN:
NUXT_GITHUB_TOKEN=<your-github-token>
The file path is {github.rootDir}/content/{page path}. Set rootDir when the docs site is not at the repository root:
export default defineAppConfig({
github: {
rootDir: 'docs'
}
})
rootDir no commit is found and the component renders nothing. Set github: false to turn off the GitHub integration entirely.Date format
github.dateFormat.locale and github.dateFormat.options are passed to Intl.DateTimeFormat. The layer defaults to zh-CN with year, month, day, hour and minute, in the server's time zone:
export default defineAppConfig({
github: {
dateFormat: {
locale: 'en-US',
options: {
dateStyle: 'medium',
timeStyle: 'short',
timeZone: 'Asia/Shanghai'
}
}
}
})
timeZone explicitly to pin it.options | Output (en-US) |
|---|---|
{ year: 'numeric', month: 'numeric', day: 'numeric' } | 10/23/2026 |
{ year: 'numeric', month: 'short', day: 'numeric' } | Oct 23, 2026 |
{ dateStyle: 'medium', timeStyle: 'short' } | Oct 23, 2026, 2:37 PM |
PR squash merge
When a PR is merged on github.com, the committer is web-flow. The component detects this, parses the PR number from the message (such as #123), shows the PR author instead and links to the PR.
Customization
Props are passed in by the docs page, so showAvatar and showMessage cannot be set from Markdown. To hide the avatar or message, or restyle it, override the component with one of the same name in your project; PageLastCommit is not part of the override contract, so check it against the new implementation when upgrading.
API
Props
| Prop | Default | Type |
|---|---|---|
stem | '' | string文件路径(不含扩展名),通常由页面自动传入 |
extension | 'md' | string文件扩展名,通常由页面自动传入 |
showMessage | true | boolean 是否显示提交信息。 |
showAvatar | true | boolean 是否显示作者头像。 |
Related
- CommitChangelog: the full commit timeline of a component or source file
Changelog
CommitChangelog
Fetch the GitHub commit history of a component or source file with `:commit-changelog` and show it as a timeline grouped by release. The file path is inferred from the name and can be tuned by directory, extension, casing and author, or cover several files.
app.config Reference
Every field of app.config.ts with its type, default value and description, generated from the layer's nuxt.schema.ts so it always matches the published version. Follow the links to the guides for usage details.