{"size": 681, "ext": "js", "max_stars_repo_path": "packages/okmarvin/lib/dispose/compose/composePaginatedIndexs.js", "max_stars_repo_name": "OkMarvin/okmarvin", "max_stars_repo_stars_event_min_datetime": "2018-11-07T09:03:46.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-06T02:41:51.000Z", "max_issues_repo_path": "packages/okmarvin/lib/dispose/compose/composePaginatedIndexs.js", "max_issues_repo_name": "OkMarvin/okmarvin", "max_issues_repo_issues_event_min_datetime": "2018-07-28T09:06:00.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-01T20:39:06.000Z", "max_forks_repo_path": "packages/okmarvin/lib/dispose/compose/composePaginatedIndexs.js", "max_forks_repo_name": "OkMarvin/okmarvin", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 6, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 24.3214285714, "max_line_length": 63, "alphanum_fraction": 0.6505139501}
'use strict'
const { isPost, shrink } = require('@okmarvin/helpers')
const paginateRobot = require('./paginateRobot')
module.exports = function (conn) {
  const {
    site: { title, description, author, paginate },
    files,
    builtAt
  } = conn
  const fields = {
    title: title,
    description: description,
    author: author,
    template: 'index.js',
    css: 'index.css',
    datePublished: builtAt,
    dateModified: builtAt,
    permalink: '/'
  }
  const permalinkFormat = '/page:num/'
  const data = files
    .filter(isPost)
    .map(shrink)
    .sort((a, b) => b.datePublished - a.datePublished)

  return paginateRobot(data, paginate, fields, permalinkFormat)
}
