Fumadocs

Git

Link docs pages to their source files, and show their last updated dates.

Setup

gitPlugin() links each docs page to its file on GitHub, and dates it with the file's last commit.

src/fumadocs.config.ts
import { defineConfig } from '@fumadocs/astro/config';
import { gitPlugin } from '@fumadocs/astro/plugins/git'; 
import { source } from './lib/source';

export default defineConfig({
  source,
  plugins: [
    gitPlugin({ user: 'fuma-nama', repo: 'fumadocs', branch: 'main' }), 
  ],
});

The default docs page shows them as "Open in GitHub" in View Options, and "Last updated on" below the content. A page module receives them as page.githubUrl and page.lastModified.

The dates come from the local git history at build time, so they need the full history. CI checkouts are often shallow, fetch the history with fetch-depth: 0 on GitHub Actions, or VERCEL_DEEP_CLONE=true on Vercel.

Options

Prop

Type

Pages without a source file in the repository, like OpenAPI pages, are left as they are.

How is this guide?

Last updated on