const moment = require('moment'); const { Component, Fragment } = require('inferno'); const Share = require('./share'); const Donates = require('./donates'); const Comment = require('./comment'); const ArticleLicensing = require('hexo-component-inferno/lib/view/misc/article_licensing'); /** * Get the word count of text. */ function getWordCount(content) { if (typeof content === 'undefined') { return 0; } content = content.replace(/<\/?[a-z][^>]*>/gi, ''); content = content.trim(); return content ? (content.match(/[\u00ff-\uffff]|[a-zA-Z]+/g) || []).length : 0; } module.exports = class extends Component { render() { const { config, helper, page, index } = this.props; const { article, plugins } = config; const { url_for, date, date_xml, __, _p } = helper; const indexLaunguage = config.language || 'en'; const language = page.lang || page.language || config.language || 'en'; const cover = page.cover ? url_for(page.cover) : null; return {/* Main content */}
{/* Thumbnail */} {cover ?
{index ? {page.title : {page.title }
: null}
{/* Metadata */} {page.layout !== 'page' ? : null} {/* Title */} {page.title !== '' ?

{index ? {page.title} : page.title}

: null} {/* Content/Excerpt */}
{/* Licensing block */} {!index && article && article.licenses && Object.keys(article.licenses) ? : null} {/* Tags */} {!index && page.tags && page.tags.length ? : null} {/* "Read more" button */} {index && page.excerpt ? {__('article.more')} : null} {/* Share button */} {!index ? : null}
{/* Donate button */} {!index ? : null} {/* Post navigation */} {!index && (page.prev || page.next) ? : null} {/* Comment */} {!index ? : null}
; } };