Page History

Page History

Add contributors and per-page Git history with one required setting.

Page History adds contributors and a collapsible commit timeline to your documentation. Try the interactive demo.

Setup

Use Node.js 24.14 or later, Fumadocs 16.17 or later, and Git with a complete checkout. Your document files normally stay inside that checkout; the plugin discovers the repository and file paths automatically.

Install the package

npm i fumadocs-page-history

Import the styles

Import after your Fumadocs styles:

app/global.css
@import 'fumadocs-page-history/css/preset.css';

Register the plugin

Only repository.url is required:

source.config.ts
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' },
        },
      ],
    ],
  },
});

Contributors and history appear after each committed document. No page-template changes are needed.

Keep your existing plugins. If a collection has its own compiler options, register Page History there using the collection configuration. Sites with blog posts or other MDX collections should register it only for the intended collection.

Optional: associate GitHub accounts

Add authorMappings to the same plugin settings:

{
  repository: { url: 'https://github.com/owner/repository' },
  authorMappings: [
    { gitName: 'Alex', githubUsername: 'alex' },
  ],
}

This associates commits by Alex with the GitHub account alex, supplying a profile link and avatar. It makes no GitHub API requests. Actual contributors still come from the page's commits. See matching rules for email selectors and additional contributors.

What happens automatically

  • History is read during compilation; Git is not needed in the deployed site.
  • File renames, co-authors, and release tags are included.
  • Both sections are enabled; the history timeline starts collapsed.
  • Dates switch from UTC server HTML to the reader's browser time zone after hydration.
  • New pages without commits or explicit contributors have no footer. Development logs explain why.
  • Git-only changes require a development-server restart or a fresh production build.

GitHub Actions needs a full checkout:

- uses: actions/checkout@v6
  with:
    fetch-depth: 0

For an existing shallow clone, run git fetch --unshallow.

Continue with Chinese setup, Configuration, or Troubleshooting.

Contributors

Page history