mirror of
https://github.com/Fechin/reference.git
synced 2026-11-22 22:02:41 +03:00
14 lines
427 B
JavaScript
14 lines
427 B
JavaScript
let pagination = require("hexo-pagination");
|
|
|
|
hexo.extend.generator.register("notes-pagination", function (locals) {
|
|
let config = this.config;
|
|
let posts = locals.posts.filter(post => post.layout === "note").sort("-date");
|
|
return pagination("notes", posts, {
|
|
perPage: config.per_page,
|
|
layout: ['notes'],
|
|
format: "%d/",
|
|
data: {
|
|
_isNotePagination: true
|
|
}
|
|
});
|
|
}); |