mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
10fc320cc8
no issue - In Ghost, 'context' means the page or section of a blog we're currently within when rendering a theme, e.g. 'post' or 'tag' or 'home'. - In handlebars 'context' refers to the blob of JSON that is tied to a template. - These two uses of the word 'context' have gotten very confusing, so I've removed all usage of 'context' within the Ghost handlebars helpers, EXCEPT where they actually refer to the current context (e.g. the is helper)
16 lines
298 B
JavaScript
16 lines
298 B
JavaScript
// # Encode Helper
|
|
//
|
|
// Usage: `{{encode uri}}`
|
|
//
|
|
// Returns URI encoded string
|
|
|
|
var hbs = require('express-hbs'),
|
|
encode;
|
|
|
|
encode = function (string, options) {
|
|
var uri = string || options;
|
|
return new hbs.handlebars.SafeString(encodeURIComponent(uri));
|
|
};
|
|
|
|
module.exports = encode;
|