2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Ghost/core/server/helpers/encode.js
Hannah Wolfe 2c6d43a0c0 Refactor helpers & tests into individual files
no issue

- Split theme helpers into individual files for each
- Do the same for tests
- Have utils to share some things between them
- Move assetHash onto config
2014-10-14 22:52:40 +02:00

15 lines
304 B
JavaScript

// # Encode Helper
//
// Usage: `{{encode uri}}`
//
// Returns URI encoded string
var hbs = require('express-hbs'),
encode;
encode = function (context, str) {
var uri = context || str;
return new hbs.handlebars.SafeString(encodeURIComponent(uri));
};
module.exports = encode;