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:
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: 0on actions/checkout. - GitLab CI: set the
GIT_DEPTHvariable to0(docs). - Bitbucket Pipelines: set
clone: depth: full(docs).
Related plugins
- mkdocs-git-revision-date-localized-plugin shows the last change date of a page.
- mkdocs-git-committers-plugin-2 shows the GitHub or GitLab profiles of a page's committers.