@@ -25,24 +25,24 @@ export function byDateAndAlphabetical(
25
25
}
26
26
}
27
27
28
- // export function byAlphabetical(
29
- // cfg: GlobalConfiguration,
30
- // ): (f1: QuartzPluginData, f2: QuartzPluginData) => number {
31
- // return (f1, f2) => {
32
- // // sort lexographically by title
33
- // const f1Title = f1.frontmatter?.title.toLowerCase() ?? ""
34
- // const f2Title = f2.frontmatter?.title.toLowerCase() ?? ""
35
- // return f1Title.localeCompare(f2Title)
36
- // }
37
- // }
28
+ export function byAlphabetical (
29
+ cfg : GlobalConfiguration ,
30
+ ) : ( f1 : QuartzPluginData , f2 : QuartzPluginData ) => number {
31
+ return ( f1 , f2 ) => {
32
+ // sort lexographically by title
33
+ const f1Title = f1 . frontmatter ?. title . toLowerCase ( ) ?? ""
34
+ const f2Title = f2 . frontmatter ?. title . toLowerCase ( ) ?? ""
35
+ return f1Title . localeCompare ( f2Title )
36
+ }
37
+ }
38
38
39
39
type Props = {
40
40
limit ?: number
41
41
sort ?: ( f1 : QuartzPluginData , f2 : QuartzPluginData ) => number
42
42
} & QuartzComponentProps
43
43
44
44
export const PageList : QuartzComponent = ( { cfg, fileData, allFiles, limit, sort } : Props ) => {
45
- const sorter = sort ?? byDateAndAlphabetical ( cfg )
45
+ const sorter = sort ?? byAlphabetical ( cfg )
46
46
let list = allFiles . sort ( sorter )
47
47
if ( limit ) {
48
48
list = list . slice ( 0 , limit )
0 commit comments