gridl / jinja2-git

Jinja2 extension to handle git-specific things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jinja2 extension to handle git-specific things

https://travis-ci.org/sobolevn/jinja2-git.svg?branch=master https://coveralls.io/repos/github/sobolevn/jinja2-git/badge.svg?branch=master

Reasoning

This plugin is used to render commit hash in jinja2 templates. We are using it to render our template version in cookicutter:

Usage

Add it as an extension for jinja2 or cookiecutter.

And then inside a template:

from jinja2 import Environment

env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit %}')
# => Commit is: c644682f4899d7e98147ce3a61a11bb13c52b3a0

Installation

$ pip install jinja2-git

About

Jinja2 extension to handle git-specific things

License:MIT License


Languages

Language:Python 100.0%