Page History

Configuration

Required settings, optional account mappings, and advanced controls.

Both compiler plugins accept the same settings. Start with the minimal setup; most sites need only repository.url.

Required and optional settings

SettingRequiredDefaultMeaning
repository.urlYes—Public HTTP(S) repository URL used for commit and release links.
authorMappingsNo[]Explicit Git-identity-to-GitHub-account associations.
displayNoBuilt-in defaultsLocale and presentation controls.
githubNoDisabledOptional build-time GitHub account lookup.
repository.directoryNoAuto-discoveredA directory inside the local checkout, used to locate Git.
contentNoFiles keep their checkout pathsLocation mapping for documents copied to another directory.

repository.url must have no credentials, query, or fragment. It is provided explicitly and is never inferred from remote credentials. Local paths and account-matching selectors stay in the build process.

Author mappings

const options = {
  repository: { url: 'https://github.com/owner/repository' },
  authorMappings: [
    { gitName: 'Alex', githubUsername: 'alex' },
    { gitEmail: 'alex@example.com', githubUsername: 'alex' },
  ],
};

Every mapping needs githubUsername and at least one of gitName or gitEmail. Names and emails ignore case and surrounding whitespace. When both selectors are present, both must match. Email-qualified mappings take precedence over name-only mappings. Multiple mappings can credit the same account.

Mapping fieldRequiredMeaning
githubUsernameYesGitHub account used for its profile and avatar.
gitNameAt least one selectorGit author name to match.
gitEmailAt least one selectorGit author email to match.
displayNameNoPublic name; defaults to githubUsername.
avatar, urlNoOverride the avatar or profile URL.
i18nNoPublic names by locale, such as { 'zh-CN': '亚历克斯' }.

Resolution order is explicit mappings, GitHub noreply addresses, then optional GitHub lookup for unresolved primary authors. Other identities keep their Git names and initials. Account names are never guessed from arbitrary Git names or emails.

Each account counts once per commit, including co-authors. Counts reflect returned history records. Matching emails and selectors are not included in public author records.

Display

Set display in plugin settings, or pass these props to GitChangelog:

const display = {
  locale: 'zh-CN',
  defaultExpanded: true,
  commitsRelativeTime: true,
};
SettingDefaultEffect
localeenDate formatting and localized contributor names.
defaultExpandedfalseShow the timeline on initial render.
commitsRelativeTimefalseRelative dates for commit rows.
showContributorstrueShow contributors above the timeline.
hideChangelogHeader, hideContributorsHeaderfalseHide section headings and their TOC entries.
hideChangelogNoChangesTextfalseHide an empty-history message in manually rendered UI.
hideSortByfalseHide the sorting button.
displayAuthorsInsideCommitLinefalseAdd avatars beside each commit.
numCommitHashLetters7Short commit hash length.
id, contributorsIdAutomaticOverride the section anchors.
className—Add wrapper classes.

Dates use the browser's time zone. Server HTML and the initial client render use UTC; mounted pages use the browser zone. A date near midnight may change after hydration. There is no time-zone setting.

locale controls dates and contributor names. Interface labels use the site's translation provider; see the complete Chinese setup.

Visible section headings appear in On this page. Automatic anchors avoid existing headings. Multiple manual instances need distinct IDs; a custom id gives contributors the default anchor <id>-contributors. Screens up to 640px hide commit hashes to leave space for messages.

Per-page controls

Extend your page schema while keeping existing compiler settings:

import { pageSchema } from 'fumadocs-core/source/schema';
import { gitChangelogSchema } from 'fumadocs-page-history/schema';

const schema = pageSchema.extend(gitChangelogSchema.shape);
FrontmatterEffect
gitChangelog: falseDisable both sections and skip Git.
gitChangelog: { disableChangelog: true }Show contributors only.
gitChangelog: { disableContributors: true }Show history only.
authors: [alex]Add explicit contributors by mapped account, display name, or Git name.

Explicit contributors can be credited without commits. Pages with neither commits nor explicit contributors have no footer.

Collection options

A collection's compiler options replace global options. Register the plugin there if the collection has its own options. For MDX, retain the Fumadocs preset:

import { applyMdxPreset, defineDocs } from 'fumadocs-mdx/config';
import { remarkGitChangelog } from 'fumadocs-page-history/remark';

export const docs = defineDocs({
  docs: {
    mdxOptions: applyMdxPreset({
      remarkPlugins: [
        [
          remarkGitChangelog,
          {
            repository: { url: 'https://github.com/owner/repository' },
          },
        ],
      ],
    }),
  },
});

Sätteri collections register gitChangelog(options) in docs.satteriOptions.mdastPlugins and set docs.compiler to 'satteri'.

Advanced Git controls

SettingDefaultMeaning
filterAll documentsSelect absolute source paths; excluded pages skip Git.
maxGitLogCountAll commitsLimit sorted results; Git still reads the full file history.
excludeBotstrueExclude bots from contributors, retaining their commits.
getCommitURLRepository commit URLCustomize commit links for another Git host.
getReleaseTagURLRepository release URLCustomize release tag links.

History follows Git-detected renames, includes merge changes relative to the first parent, and sorts by author date. Lightweight and annotated tags are supported. Commit Markdown links #123 to /issues/123; raw HTML is disabled.

Copied documents

When compilation uses a copy of your documents, declare where it belongs in the checkout:

{
  repository: {
    url: 'https://github.com/owner/repository',
    directory: '/workspace/repository',
  },
  content: {
    directory: '/workspace/document-copy',
    pathInRepository: 'apps/docs/content',
  },
}

A copied guide.mdx reads history for apps/docs/content/guide.mdx. The package resolves native Windows or POSIX disk paths, handles symlinked directories, and produces Git-relative paths internally. Files outside content.directory and repository paths that escape the checkout are rejected. Use pathInRepository: '.' when the content directory represents the repository root.

Optional GitHub lookup

Ordinary emails can be associated with GitHub accounts during compilation:

{
  repository: { url: 'https://github.com/owner/repository' },
  github: { token: process.env.GITHUB_TOKEN },
}

Only unresolved primary authors are queried. Commits must already exist in that GitHub repository. Co-authors are not assigned the primary author's account. Provide the token to the documentation build step; public repositories need no additional repository permission, and fine-grained tokens for private repositories need Contents: read.

SettingDefaultMeaning
tokenNoneMissing tokens skip lookup with one warning.
cacheDirnode_modules/.cache/fumadocs-page-historyGit-root-relative cache directory; false disables disk caching.
maxRequests100Budget per reader/compiler worker.
timeoutMs5000Timeout per request.

Successful mappings are cached for seven days; unavailable or unassociated commits for five minutes. Network failures and rate limits are not persisted. Cache keys hash identity emails and are separated by repository. Tokens and emails are never included in pages or cached records.

Requests are serialized within each reader, with deduplication and shared disk caching. Workers have separate budgets and may duplicate cold-cache requests. Authentication failures, rate limits, server errors, and timeouts stop further requests in that reader; cached mappings remain available. Lookup or cache failures fall back to local author information, with at most one warning per reader. Omit github for offline builds.

Contributors

Page history