0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/server/helpers/image.js
2014-12-29 18:44:15 +00:00

18 lines
479 B
JavaScript

// Usage: `{{image}}`, `{{image absolute="true"}}`
//
// Returns the URL for the current object scope i.e. If inside a post scope will return image permalink
// `absolute` flag outputs absolute URL, else URL is relative.
var config = require('../config'),
image;
image = function (options) {
var absolute = options && options.hash.absolute;
if (this.image) {
return config.urlFor('image', {image: this.image}, absolute);
}
};
module.exports = image;