Skip to content

Commit a6d8a87

Browse files
authored
Revert "fix: pagination_dir setting (#98)"
This reverts commit 59aeb87.
1 parent 59aeb87 commit a6d8a87

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

lib/generator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = function(locals) {
88

99
posts.data.sort((a, b) => (b.sticky || 0) - (a.sticky || 0));
1010

11-
const paginationDir = config.index_generator.pagination_dir || config.pagination_dir || 'page';
11+
const paginationDir = config.pagination_dir || 'page';
1212
const path = config.index_generator.path || '';
1313

1414
return pagination(path, posts, {

test/index.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe('Index generator', () => {
123123
});
124124
});
125125

126-
it('custom pagination_dir - global setting', () => {
126+
it('custom pagination_dir', () => {
127127
hexo.config.index_generator.per_page = 1;
128128
hexo.config.pagination_dir = 'yo';
129129

@@ -135,18 +135,4 @@ describe('Index generator', () => {
135135

136136
});
137137

138-
it('custom pagination_dir - plugin setting', () => {
139-
hexo.config.index_generator.per_page = 1;
140-
hexo.config.index_generator.pagination_dir = 'yoyo';
141-
142-
const result = generator(locals);
143-
144-
result[0].path.should.eql('');
145-
result[1].path.should.eql('yoyo/2/');
146-
result[2].path.should.eql('yoyo/3/');
147-
148-
// Restore config
149-
hexo.config.index_generator.per_page = 10;
150-
hexo.config.index_generator.pagination_dir = 'page';
151-
});
152138
});

0 commit comments

Comments
 (0)