Getting started
Show each page's Git history and contributors at the bottom of your Fumadocs pages.
Page History adds two sections to the end of every Markdown and MDX page, built from the file's commits:
- Contributors: everyone who committed to the page, including co-authors, with GitHub avatars when they can be found.
- Page history: when the page was last edited, with a collapsible list of its commits.
While you write, it can also highlight uncommitted edits directly in the page. The demo shows all three.
Setup
You need Node.js 24.14 or later, Fumadocs 16.17 or later, and a Git checkout with full history.
Install the package
npm i fumadocs-page-historyImport the styles
Add this after your Fumadocs styles:
@import 'fumadocs-page-history/css/preset.css';Register the plugin
Add the plugin to source.config.ts. The only required option is your repository URL, which is used for commit and release links:
import { defineConfig } from 'fumadocs-mdx/config';
import { remarkGitChangelog } from 'fumadocs-page-history/remark';
export default defineConfig({
mdxOptions: {
remarkPlugins: [
[
remarkGitChangelog,
{
repository: { url: 'https://github.com/owner/repository' },
},
],
],
},
});Start the development server and open any committed page: contributors and history now appear at the bottom. You don't need to change your page layout.
If you already use other remark plugins, add this one to the same list. Global mdxOptions apply to every MDX collection, including a blog. To add history to your docs only, or if your docs collection sets its own compiler options, register the plugin in that collection instead. See Collection options.
How it works
- History is read from Git when a page compiles and saved into the page, so your deployed site doesn't need Git.
- For the same reason, a new commit appears only after the page compiles again. Restart the development server or rebuild.
- A page with no commits yet shows nothing until you commit it, unless you credit contributors in its frontmatter.
- Renamed files keep their history. Co-authors and release tags are included.
- The commit list starts collapsed. To change this and other display settings, see Display & language.
Deploy
Your build needs a checkout with full history, not a shallow clone. In GitHub Actions, check out with:
- uses: actions/checkout@v6
with:
fetch-depth: 0To convert an existing shallow clone, run git fetch --unshallow.
Next steps
| I want to | Read |
|---|---|
| See my uncommitted edits highlighted in pages | Workspace changes |
| Show GitHub avatars and profile links | Contributors |
| Change how history looks, or use Chinese | Display & language |
| Look up an option | Configuration reference |
| Fix a missing or outdated footer | Troubleshooting |