2019-12-23 22:11:22 +00:00
|
|
|
const { Component, Fragment } = require('inferno');
|
2020-01-23 04:07:43 +00:00
|
|
|
const Paginator = require('hexo-component-inferno/lib/view/misc/paginator');
|
2019-12-23 22:11:22 +00:00
|
|
|
const Article = require('./common/article');
|
|
|
|
|
|
|
|
module.exports = class extends Component {
|
|
|
|
render() {
|
2019-12-24 05:36:39 +00:00
|
|
|
const { config, page, helper } = this.props;
|
|
|
|
const { __, url_for } = helper;
|
2019-12-23 22:11:22 +00:00
|
|
|
|
|
|
|
return <Fragment>
|
2019-12-24 05:36:39 +00:00
|
|
|
{page.posts.map(post => <Article config={config} page={post} helper={helper} index={true} />)}
|
2019-12-23 22:11:22 +00:00
|
|
|
{page.total > 1 ? <Paginator
|
|
|
|
current={page.current}
|
|
|
|
total={page.total}
|
|
|
|
baseUrl={page.base}
|
|
|
|
path={config.pagination_dir}
|
2019-12-24 05:36:39 +00:00
|
|
|
urlFor={url_for}
|
|
|
|
prevTitle={__('common.prev')}
|
|
|
|
nextTitle={__('common.next')} /> : null}
|
2019-12-23 22:11:22 +00:00
|
|
|
</Fragment>;
|
|
|
|
}
|
2019-12-24 05:36:39 +00:00
|
|
|
};
|