'use strict';
const { Component } = require('inferno');
const MetaTags = require('../misc/meta');
const OpenGraph = require('../misc/open_graph');
const Plugins = require('./plugins');
module.exports = class extends Component {
render() {
const { env, site, config, helper, page } = this.props;
const { is_post, url_for, cdn, iconcdn, fontcdn } = helper;
const {
url,
meta_generator = true,
meta = [],
open_graph,
canonical_url,
rss,
favicon,
article,
highlight
} = config;
let hlTheme, images;
if (highlight && highlight.enable === false) {
hlTheme = null;
} else if (article && article.highlight && article.hightlight.theme) {
hlTheme = article.hightlight.theme;
} else {
hlTheme = 'atom-one-light';
}
if (typeof page.og_image === 'string') {
images = [page.og_image];
} else if (helper.has_thumbnail(page)) {
images = [helper.get_thumbnail(page)];
} else if (article && typeof article.og_image === 'string') {
images = [article.og_image];
} else if (page.content && page.content.includes(']*src=['"]([^'"]+)([^>]*>)/gi;
while ((img = imgPattern.exec(page.content)) !== null) {
images.push(img[1]);
}
} else {
images = [url_for('/images/og_image.png')];
}
return