Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
descriptions += util.htmlTag('div', { class: 'og-title' }, escapeHTML(ogp.ogTitle))
// Description
if (config.description && ogp.hasOwnProperty('ogDescription')) {
let description = ogp.ogDescription
if (description && description.length > config.descriptionLength) {
description = description.slice(0, config.descriptionLength) + '…'
}
descriptions += util.htmlTag('div', { class: 'og-description' }, escapeHTML(description))
}
descriptions = util.htmlTag('div', { class: 'descriptions' }, descriptions)
const tag = util.htmlTag('div', { class: 'link-area' }, image + descriptions)
return util.htmlTag('a', { href: url, class: config.className, target: config.target, rel: config.rel }, tag)
})
.catch(function (error) {
hexo.extend.tag.register('issue', function (args) {
// {% issue 74 'not currently supported' %}
const num = args[0]
const attrs = {
href: `https://github.com/cypress-io/cypress/issues/${num}`,
target: '_blank',
}
const text = args[1] || `issue #${num}`
return util.htmlTag('a', attrs, text)
})
// Description
if (config.description && ogp.hasOwnProperty('ogDescription')) {
let description = ogp.ogDescription
if (description && description.length > config.descriptionLength) {
description = description.slice(0, config.descriptionLength) + '…'
}
descriptions += util.htmlTag('div', { class: 'og-description' }, escapeHTML(description))
}
descriptions = util.htmlTag('div', { class: 'descriptions' }, descriptions)
const tag = util.htmlTag('div', { class: 'link-area' }, image + descriptions)
return util.htmlTag('a', { href: url, class: config.className, target: config.target, rel: config.rel }, tag)
})
.catch(function (error) {
function meta(options) {
return tag('meta', options);
}
function og(name, content) {
return `${htmlTag('meta', {
property: name,
content
})}\n`;
}
if (ogp.hasOwnProperty('ogImage')) {
image += util.htmlTag('img', { src: ogp.ogImage.url } , '');
image = util.htmlTag('div', { class: 'og-image'}, image)
}
descriptions += util.htmlTag('div', { class: 'og-title' }, escapeHTML(ogp.ogTitle));
if (ogp.hasOwnProperty('ogDescription')) {
const description = adjustLength(ogp.ogDescription);
descriptions += util.htmlTag('div', { class: 'og-description' }, escapeHTML(description));
}
descriptions = util.htmlTag('div', { class: 'descriptions' }, descriptions);
const tag = util.htmlTag('div', { class: 'link-area' }, image + descriptions);
return util.htmlTag('a', { href: options.url, class: className, target: options.target, rel: options.rel }, tag);
})
.catch(function (error) {
module.exports = function (args, root) {
var img_path = args[0];
var config = {
src: root + img_path
}
return '<div class="owl-media owl-image owl-local">' + util.htmlTag('img', config) + '</div>';
}
result += meta('twitter:image', images[0]);
}
if (options.twitter_id) {
let twitterId = options.twitter_id;
if (twitterId[0] !== '@') twitterId = `@${twitterId}`;
result += meta('twitter:creator', twitterId);
}
if (options.twitter_site) {
result += meta('twitter:site', options.twitter_site);
}
if (options.google_plus) {
result += `${htmlTag('link', {rel: 'publisher', href: options.google_plus})}\n`;
}
if (options.fb_admins) {
result += og('fb:admins', options.fb_admins);
}
if (options.fb_app_id) {
result += og('fb:app_id', options.fb_app_id);
}
return result.trim();
}
module.exports = function (hexo, args) {
var config = { src: hexo.config.root + args[0] }
return '<div class="owl-media owl-image owl-local">' + util.htmlTag('img', config) + '</div>';
}