'use strict'; const { url_for } = require('hexo-util'); function listPostsHelper(posts, options) { if (!options && (!posts || !Object.prototype.hasOwnProperty.call(posts, 'length'))) { options = posts; posts = this.site.posts; } options = options || {}; const { style = 'list', transform, separator = ', ' } = options; const orderby = options.orderby || 'date'; const order = options.order || -1; const className = options.class || 'post'; const amount = options.amount || 6; // Sort the posts posts = posts.sort(orderby, order); // Limit the number of posts if (amount) posts = posts.limit(amount); let result = ''; if (style === 'list') { result += `