{{ fileHash }}
The {{ fileHash }} Handlebars helper generates an md5 hash from a specified file's content. Perfect for automatically cache-busting modified assets (e.g. stylesheets).
Quickstart
In the root of your project, run the following in the command line:
npm install handlebars-helper-filehash --save-dev
Assemble Usage
If you use Assemble and Grunt, add handlebars-helper-filehash
to the helpers
property in your Gruntfile's Assemble task or target options:
grunt;
You can now use begin using the helper in your templates. To use the helper, pass a file path and optionally include a number as a second parameter if you wish to limit the output to a set length.
Template:
Output:
License and Copyright
Copyright (c) 2014 Andrew Duthie
Released freely under the MIT License (refer to LICENSE.txt)