UNPKG

gpreview

Version:

Preview Ghost themes locally without a full Ghost installation

42 lines 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.metaHelper = void 0; exports.metaHelper = { title: function (_options) { const site = this.site || this['@site']; const post = this.post || this['@post']; const page = this.page || this['@page']; const tag = this.tag || this['@tag']; const author = this.author || this['@author']; if (post || page) { const content = post || page; return content?.meta_title || content?.title || site?.title || ''; } else if (tag) { return tag.meta_title || `${tag.name} - ${site?.title}` || ''; } else if (author) { return author.meta_title || `${author.name} - ${site?.title}` || ''; } return site?.title || ''; }, description: function (_options) { const site = this.site || this['@site']; const post = this.post || this['@post']; const page = this.page || this['@page']; const tag = this.tag || this['@tag']; const author = this.author || this['@author']; if (post || page) { const content = post || page; return content?.meta_description || content?.custom_excerpt || content?.excerpt || site?.description || ''; } else if (tag) { return tag.meta_description || tag.description || site?.description || ''; } else if (author) { return author.meta_description || author.bio || site?.description || ''; } return site?.description || ''; } }; //# sourceMappingURL=meta.js.map