gpreview
Version:
Preview Ghost themes locally without a full Ghost installation
23 lines • 705 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.imgUrlHelper = imgUrlHelper;
function imgUrlHelper(image, options) {
let imgUrl;
if (!options || typeof options !== 'object') {
const context = this;
imgUrl = context.feature_image || context.profile_image || context.cover_image || '';
}
else {
imgUrl = String(image || '');
}
if (!imgUrl) {
return '';
}
if (imgUrl.startsWith('http://') || imgUrl.startsWith('https://')) {
return imgUrl;
}
const site = this.site || this['@site'];
const siteUrl = site?.url || '';
return `${siteUrl}/${imgUrl}`;
}
//# sourceMappingURL=imgUrl.js.map