Skip to content
Snippets Groups Projects
Commit 47afdf80 authored by David Sveningsson's avatar David Sveningsson
Browse files

update readme

parent 8bd9045a
Branches
Tags
No related merge requests found
# Nunjucks filters and helpers for generating HTML static pages
## `assetUrl` filter
## Usage
It exports a single function taking the nunjucks `Environment` instance:
```js
const env = new nunjucks.Environment(..);
require('@sidvind/build-nunjucks')(env);
```
With `grunt-nunjucks-2-html`:
```js
nunjucks: {
options: {
configureEnvironment: require('@sidvind/build-nunjucks'),
},
}
```
## Filters
### `assetUrl` filter
Generate a cache-buster URL for an asset.
......@@ -16,7 +37,7 @@ Output:
<link rel="stylesheet" href="assets/css/site.min.css?e4202148fa903327c91d89f0c6fec4af">
```
## `sri` filter
### `sri` filter
SRI integrity (hash) of an asset.
......@@ -32,11 +53,13 @@ Output:
<link rel="stylesheet" .. integrity="sha384-zwJH9nUlOkCDg2d1r1c5jLqv8NQ2O9CHKIa0sAYozc0MD1aPSbNqGM9YY7+Sz6n1">
```
## `now` global
## Globals
### `now` global
Build timestamp.
Build timestamp (seconds since 1 jan 1970).
## `git` global
### `git` global
Git metadata.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment