MkDocs plugin to get the latest git tag from the local repository
Project description
MkDocs Plugin : latest-git-tag
This is a simple MkDocs plugin that just gets the
most recent Tag
from the local Git repository and makes it available as a
markdown tag in the template.
The idea behind this is that GitHub uses the Tag
to name the release and,
therefore we can use it to display the version of the documentation that
corresponds to the release.
The Tag is just returned as a string with no formatting applied. If none is found, it returns "No Tags found"
There is a Demo Site
Installation
Install the package with pip:
pip install mkdocs-latest-git-tag-plugin
or, if you are using Poetry:
poetry add mkdocs-latest-git-tag-plugin --group dev
Usage
Activate the plugin in your mkdocs.yml
:
plugins:
- latest-git-tag
If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if here is noplugins
entry set.
Then, in your template, you can use the {{ latest_git_tag }}
variable:
# My Project
Version: {{ latest_git_tag }}
The spaces around the tag are optional and it is case insensitive.
Configuration
At this time there are no configuration options.
License
This is released under the MIT License. See the bundled LICENSE file for more details.
TODO
- Add tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs_latest_git_tag_plugin-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab51de9aaaf412110ce1935d4c22686c23383d2078feb28708646c3801d89327 |
|
MD5 | c82a2478024f85677b086e776d3269da |
|
BLAKE2b-256 | fed014db15da4f526392603729768e8f961e9e16d52db5e48892437c6e912262 |
Hashes for mkdocs_latest_git_tag_plugin-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d27c6d95e19f8fc9133840492ed059ac1b026e0d0dce4c368b803b9367f5a07 |
|
MD5 | 4af444d80beb815994285063070a471b |
|
BLAKE2b-256 | a277960575f50d2ad6f996066000081038771bb7caf5a810fd8eb3f87c6a472a |