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
| Setting | Required | Default | Meaning |
|---|---|---|---|
repository.url | Yes | — | Public HTTP(S) repository URL used for commit and release links. |
authorMappings | No | [] | Explicit Git-identity-to-GitHub-account associations. |
display | No | Built-in defaults | Locale and presentation controls. |
github | No | Disabled | Optional build-time GitHub account lookup. |
repository.directory | No | Auto-discovered | A directory inside the local checkout, used to locate Git. |
content | No | Files keep their checkout paths | Location 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 field | Required | Meaning |
|---|---|---|
githubUsername | Yes | GitHub account used for its profile and avatar. |
gitName | At least one selector | Git author name to match. |
gitEmail | At least one selector | Git author email to match. |
displayName | No | Public name; defaults to githubUsername. |
avatar, url | No | Override the avatar or profile URL. |
i18n | No | Public 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,
};| Setting | Default | Effect |
|---|---|---|
locale | en | Date formatting and localized contributor names. |
defaultExpanded | false | Show the timeline on initial render. |
commitsRelativeTime | false | Relative dates for commit rows. |
showContributors | true | Show contributors above the timeline. |
hideChangelogHeader, hideContributorsHeader | false | Hide section headings and their TOC entries. |
hideChangelogNoChangesText | false | Hide an empty-history message in manually rendered UI. |
hideSortBy | false | Hide the sorting button. |
displayAuthorsInsideCommitLine | false | Add avatars beside each commit. |
numCommitHashLetters | 7 | Short commit hash length. |
id, contributorsId | Automatic | Override 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);| Frontmatter | Effect |
|---|---|
gitChangelog: false | Disable 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
| Setting | Default | Meaning |
|---|---|---|
filter | All documents | Select absolute source paths; excluded pages skip Git. |
maxGitLogCount | All commits | Limit sorted results; Git still reads the full file history. |
excludeBots | true | Exclude bots from contributors, retaining their commits. |
getCommitURL | Repository commit URL | Customize commit links for another Git host. |
getReleaseTagURL | Repository release URL | Customize 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.
| Setting | Default | Meaning |
|---|---|---|
token | None | Missing tokens skip lookup with one warning. |
cacheDir | node_modules/.cache/fumadocs-page-history | Git-root-relative cache directory; false disables disk caching. |
maxRequests | 100 | Budget per reader/compiler worker. |
timeoutMs | 5000 | Timeout 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.