Skip to content

mkdocs-git-authors-plugin

An MkDocs plugin that shows the git authors of each page. It uses git blame, so it only counts authors of the lines that are on the page now.

The authors of this page: Tim Vink

Setup

pip install mkdocs-git-authors-plugin

Add the plugin to mkdocs.yml:

plugins:
  - search
  - git-authors

MkDocs only enables the search plugin by default when there is no plugins entry, so list it too.

Next, show the authors on your pages: see Usage. To change the plugin's behaviour, see Options.

Full git history in CI

The plugin needs the full git history. Many CI systems make a shallow clone by default, which attributes all lines to the last commit. Fetch the full history instead:

  • GitHub Actions: set fetch-depth: 0 on actions/checkout.
  • GitLab CI: set the GIT_DEPTH variable to 0 (docs).
  • Bitbucket Pipelines: set clone: depth: full (docs).