Jinja2 extension to handle git-specific things
Installation
$ pip install jinja2-git
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
Or short version:
from jinja2 import Environment
env = Environment(extensions=['jinja2_git.GitExtension'])
template = env.from_string('Commit is: {% gitcommit short=True %}')
# => Commit is: c644682
License
Metadata
Release files for jinja2-git 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jinja2-git-1.2.0.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jinja2_git-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / jinja2-git-1.2.0.tar.gz
| Download URL | jinja2-git-1.2.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df47e7ec0dd3ca937a3f18dac4fd69eaf16675b6f63c5c95969650a02f24e639
|
|
BLAKE2b-256 checksum How to use checksums |
a21f3cfcd5cd257d7520a91f2f80f0e50a34ca89eae3621fdb146fc9c24a7d8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0
|
Release files / jinja2_git-1.2.0-py3-none-any.whl
| Download URL | jinja2_git-1.2.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b11b45ae2e8e8e3f622ef444523b3d856b3af150fa443a4ae6adeb47dfd2024
|
|
BLAKE2b-256 checksum How to use checksums |
3a061123613bb2d9df64e8aefa4e3095b9db87b9a0d258dd1e1df48c53feecd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.14 CPython/3.8.9 Darwin/18.7.0
|