Configuration reference
Plugin options, per-page settings, collection setup, and Git options.
Every option for the two compiler plugins, remarkGitChangelog for MDX and gitChangelog for Sätteri, which take the same settings. If you're new to Page History, start with Getting started.
Required and optional settings
| Option | Required | Default | Description |
|---|---|---|---|
repository.url | Yes | — | Public repository URL, used for commit and release links. |
authorMappings | No | [] | Link Git authors to GitHub accounts. See Author mappings. |
display | No | — | Appearance and language. See Display & language. |
github | No | Off | Look up GitHub accounts during the build. See GitHub lookup. |
repository.directory | No | Found automatically | A folder inside the checkout, used to find the Git repository. |
content | No | — | Where your content lives in the repository when the build uses a copy. See Copied documents. |
getHistoryPaths | No | — | Older paths to include in a page's history. See Migration history. |
workspaceChanges | No | false | Highlight uncommitted edits during development. See Workspace changes. |
repository.url must be a plain URL, without credentials, a query string, or a fragment. Page History never reads it from your Git remote, so a token in a remote URL can't leak into your pages. Local paths and author-matching rules stay in the build and are never written into pages.
Per-page controls
To change the sections for one page, first add Page History's fields to your page schema:
import { pageSchema } from 'fumadocs-core/source/schema';
import { gitChangelogSchema } from 'fumadocs-page-history/schema';
const schema = pageSchema.extend(gitChangelogSchema.shape);Then use these frontmatter fields:
| Frontmatter | Effect |
|---|---|
gitChangelog: false | Hide both sections. Git isn't read for this page. |
gitChangelog: { disableChangelog: true } | Show contributors only. |
gitChangelog: { disableContributors: true } | Show history only. |
authors: [alex] | Credit people who have no commits, by mapped GitHub username, display name, or Git name. |
A page with no commits and no authors shows neither section.
Collection options
If a collection sets its own compiler options, they replace the global ones, so register the plugin in the collection too. For MDX, wrap the options in applyMdxPreset to keep the Fumadocs defaults:
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' },
},
],
],
}),
},
});For Sätteri, add gitChangelog(options) to docs.satteriOptions.mdastPlugins and set docs.compiler to 'satteri'.
Advanced Git controls
| Option | Default | Description |
|---|---|---|
filter | All files | Receives each file's absolute path. Return false to skip the page without reading Git. |
maxGitLogCount | All commits | Show only the newest commits, up to this number. |
excludeBots | true | Leave bots out of contributors. Their commits still appear in the history. |
getCommitURL | GitHub commit URL | Build commit links for another Git host. |
getReleaseTagURL | GitHub release URL | Build release tag links for another Git host. |
How history is collected:
- Renames that Git detects are followed. A copy of a page starts with its own, empty history.
- Commits made on merged branches are included, so a page created on a branch keeps its first commit. A merge commit appears only if it made its own edits to the page.
- Commits are sorted by author date, newest first.
- Lightweight and annotated tags both appear as release labels.
- Commit messages are rendered as Markdown with HTML disabled, and
#123links to that issue.
Migration history
Git stops following a rename when the file also changed a lot, for example when you convert Vue Markdown pages to MDX. To keep the older history, list the previous paths yourself. This is more precise than lowering Git's rename threshold for every page:
const previousPaths: Record<string, readonly string[]> = {
'docs/about/introduction.mdx': ['docs/about/introduction.md'],
};
const options = {
repository: { url: 'https://github.com/owner/repository' },
getHistoryPaths: (sourcePath: string) => previousPaths[sourcePath] ?? [],
};The same options work with remarkGitChangelog, Sätteri's gitChangelog, and the Node API:
import { createHistoryReader } from 'fumadocs-page-history/git';
const reader = createHistoryReader(options);
const commits = await reader.read('docs/about/introduction.mdx');getHistoryPaths receives the page's path relative to the Git root, after any content mapping. It returns older paths, also relative to the Git root, even when repository.directory is a subfolder. Return [] for pages without older paths; the current path is always included. Paths must stay inside the repository. Nothing is inferred: a .md and an .mdx file are treated as unrelated unless you list them.
Renames of each older path are followed as well. All commits are merged, de-duplicated, sorted by date, and then limited by maxGitLogCount. Author mappings, co-authors, GitHub lookup, release tags, and custom links apply to the merged list. The function runs only during the build and isn't included in your pages.
Copied documents
If your build compiles a copy of the content, for example in a temporary folder, tell Page History where the original lives in the repository:
{
repository: {
url: 'https://github.com/owner/repository',
directory: '/workspace/repository',
},
content: {
directory: '/workspace/document-copy',
pathInRepository: 'apps/docs/content',
},
}With this setup, /workspace/document-copy/guide.mdx shows the history of apps/docs/content/guide.mdx. Windows paths, POSIX paths, and symlinked folders all work. Files outside content.directory, and paths that point outside the repository, are rejected. If the content folder is the repository root, use pathInRepository: '.'.