@@ -56,8 +56,6 @@ export function resolvePaginationConfig(
5656 classifierType : ClassifierTypeEnum ,
5757 pagination = { } as PaginationConfig ,
5858 indexPath ,
59- pid , // post / tag
60- id , // post / js
6159 ctx : VuePressContext ,
6260 keys : string [ ] = [ '' ] , // ['js']
6361) {
@@ -76,8 +74,10 @@ export function resolvePaginationConfig(
7674
7775 filter :
7876 classifierType === ClassifierTypeEnum . Directory
79- ? getIdentityFilter ( pid , id )
80- : getFrontmatterClassifierPageFilter ( keys , id ) ,
77+ ? function ( page , id , pid ) {
78+ return page . pid === pid && page . id === id
79+ }
80+ : getFrontmatterClassifierPageFilter ( keys ) ,
8181
8282 sorter : ( prev : VuePressPage , next : VuePressPage ) => {
8383 const prevTime = new Date ( prev . frontmatter . date ) . getTime ( )
@@ -89,22 +89,13 @@ export function resolvePaginationConfig(
8989 )
9090}
9191
92- function getIdentityFilter ( pid , id ) {
93- return new Function (
94- 'page' ,
95- `return page.pid === ${ JSON . stringify ( pid ) } && page.id === ${ JSON . stringify (
96- id ,
97- ) } `,
98- )
99- }
100-
101- function getFrontmatterClassifierPageFilter ( keys , value ) {
92+ function getFrontmatterClassifierPageFilter ( keys ) {
10293 return new Function (
10394 // @ts -ignore
104- 'page' ,
95+ 'page' , 'id' , 'pid' ,
10596 `
10697const keys = ${ JSON . stringify ( keys ) } ;
107- const value = ${ JSON . stringify ( value ) } ;
98+ const value = id ;
10899return keys.some(key => {
109100 const _value = page.frontmatter[key]
110101 if (Array.isArray(_value)) {
0 commit comments