timvink / mkdocs-git-authors-plugin

MkDocs plugin to display git authors of a page.
https://timvink.github.io/mkdocs-git-authors-plugin
MIT License
68 stars 17 forks source link

Add enable_if_env option #51

Closed ldeluigi closed 2 years ago

ldeluigi commented 3 years ago

Like https://github.com/zhaoterryy/mkdocs-git-revision-date-plugin#enabled_if_env

It's useful in a CI environment where you don't know if there is a git repository available

ldeluigi commented 3 years ago

A fallback to empty author would also be fine if git is not available

timvink commented 3 years ago

I like the fallback option better. When git is not available we can fallback to disabling the plugin (with a warning).

For the implementation we can borrow from https://timvink.github.io/mkdocs-git-revision-date-localized-plugin/options/#fallback_to_build_date.

Would you be willing to contribute a PR for this?

ldeluigi commented 3 years ago

At the moment I'm too busy. I'll look at it when I get some free time, sorry.