Skip to content

Commit

Permalink
refactor(ES2015): use let/const & arrow-return (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin authored and tomap committed Feb 10, 2019
1 parent ed8c38d commit 7e7ea5d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/generator.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
'use strict';

var pagination = require('hexo-pagination');
const pagination = require('hexo-pagination');

module.exports = function(locals) {
var config = this.config;
var perPage = config.tag_generator.per_page;
var paginationDir = config.pagination_dir || 'page';
var tags = locals.tags;
var tagDir;
const config = this.config;
const perPage = config.tag_generator.per_page;
const paginationDir = config.pagination_dir || 'page';
const tags = locals.tags;
let tagDir;

var pages = tags.reduce(function(result, tag) {
const pages = tags.reduce((result, tag) => {
if (!tag.length) return result;

var posts = tag.posts.sort('-date');
var data = pagination(tag.path, posts, {
const posts = tag.posts.sort('-date');
const data = pagination(tag.path, posts, {
perPage: perPage,
layout: ['tag', 'archive', 'index'],
format: paginationDir + '/%d/',
Expand Down

0 comments on commit 7e7ea5d

Please sign in to comment.