4.3.3 • Published 3 years ago

hapi-nunjucks-helpers v4.3.3

Weekly downloads
14
License
MIT
Repository
github
Last release
3 years ago

hapi-nunjucks-helpers

Helpers for hapi-nunjucks

Usage

Use as you would a normal hapijs plugin.

Options

  • assets
    • dist - Directories files are built to. Default: none.
    • mappingFile - File output by clientkit to map hashed assets.
    • endpoint - Base directory for assets. Default: none.
    • cdn - Optional domain for assets. Default: none.
    • cache - If true, caches contents of mappingFile. Default: false

Filters:

asset

Reads from clientkit generated mapping file if available.

<script src="{{ 'common.js' | asset }}"></script>

Also possible to pass a version to force new fetch from cache:

<script src="{{ 'common.js' | asset(2) }}"></script>
<!-- /common.js?v=2 ?>

cdn

Prefixes asset with cdn path from assets.cdn property.

<img src="{{ 'logos/logo.png' | cdn }}">

With css/js

<script src="{{ 'common.js' | asset | cdn }}"></script>

date

Formats a date-string with momentjs

From Now: {{ new Date | date }}
Format String: {{ new Date | date("YYYY MM DD") }}

inline

Takes a file and spits out the contents.

<script>{{ 'common.js' | inline }}</script>
4.3.3

3 years ago

4.3.1

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.3.0

6 years ago

3.2.0

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago