GOV.UK Frontend Jinja Macros
Project description
GOV.UK Frontend Jinja Macros
This repository contains Jinja macro ports of the GOV.UK Frontend. This is currently up to date with release v3.7.0.
How to use
Here is a simple example Flask app that demonstrates how to import and use the GOV.UK Jinja macros.
After running pip install govuk-frontend-jinja
, ensure that you tell Jinja where to load the templates from using the PackageLoader
as follows:
from flask import Flask
from jinja2 import ChoiceLoader, PackageLoader, PrefixLoader
app = Flask(__name__)
loader = ChoiceLoader([
PackageLoader('app'),
PrefixLoader({
'govuk_frontend_jinja': PackageLoader('govuk_frontend_jinja')
})
])
app.jinja_loader = loader
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
govuk-frontend-jinja-0.2.0.tar.gz
(17.6 kB
view hashes)
Built Distribution
Close
Hashes for govuk-frontend-jinja-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e29d447b18ba95d7267d4e11b7f059b1c89d5ba4dd748632d282574b1264c90 |
|
MD5 | 5566d93142bd1888aa6bc53aa5783611 |
|
BLAKE2b-256 | fce9ea7a7a7fc5e0320ec3b00d677bc62b9e25e6a8e832ee9e007187576a937b |
Close
Hashes for govuk_frontend_jinja-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07976bfadd5e5bbee6d511636c9af2d9410e94885702a30b337e3d5db87a1bb4 |
|
MD5 | 9d3145cf8f752084d20ae6d03ff1c6d7 |
|
BLAKE2b-256 | ecee22dcb74766cf094b70d294130a841d42e86a2de2f41ea9ffe5cb2d10e43d |