handlebars-cloudinary
handlebars / cloudinary
helper to generate cloudinary urls.
install
npm i --save handlebars-cloudinary
usage
import { handlebarsCloudinary } from 'handlebars-cloudinary'
import { handlebars } from 'handlebars'
Handlebars.registerHelper('cloudinary', handlebarsCloudinary('mycloud'))
handlebars.compile('<img src="{{cloudinary cloudinary_id "{ width:400, height:300, crop:\'fill\' }"}}" alt="image alt">').template({})
quotes
The example above shows a problem you run into if trying to declare strings in
js. The escaped quotes will work fine in this case.
In a handlebars template file, you can just use single quotes.
compatibility
dist/index.js
should be fully compatible with node 6
Author
Levi Wheatcroft levi@wht.cr
Contributing
Contributions welcome; Please submit all pull requests against the master
branch.
License
MIT