2014-10-21 14:50:34 +04:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
2014-12-28 22:38:29 +03:00
|
|
|
var config = require('../config'),
|
2014-10-21 14:50:34 +04:00
|
|
|
image;
|
|
|
|
|
|
|
|
image = function (options) {
|
|
|
|
var absolute = options && options.hash.absolute;
|
2014-12-28 22:38:29 +03:00
|
|
|
|
2014-10-21 14:50:34 +04:00
|
|
|
if (this.image) {
|
2014-12-28 22:38:29 +03:00
|
|
|
return config.urlFor('image', {image: this.image}, absolute);
|
2014-10-21 14:50:34 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = image;
|