fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
318 stars 50 forks source link

Add branch as information available through git #216

Closed fralau closed 5 months ago

fralau commented 5 months ago

@ jbadwaik wrote:

I am using mkdocs-macro plugin to configure the mike plugin for mkdocs in order to display multi-version documentation. In that context, I would like to mark certain branches as dev and others as experimental. And for that, I need the branch names in git as well.

I've added the branch property in get_git_info().

In other words allow the following call:

Git branch: {{ git.branch }

Would return the name of the branch (e.g. master); this equivalent to:

git rev-parse --abbrev-ref HEAD

See PR #211

Question for the community: what do you think of this proposal? Does it meet your requirements?

fralau commented 5 months ago

In the absence of objections, this modification is passed.