@@ -25,24 +25,24 @@ export function byDateAndAlphabetical(
2525 }
2626}
2727
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+ }
3838
3939type Props = {
4040 limit ?: number
4141 sort ?: ( f1 : QuartzPluginData , f2 : QuartzPluginData ) => number
4242} & QuartzComponentProps
4343
4444export const PageList : QuartzComponent = ( { cfg, fileData, allFiles, limit, sort } : Props ) => {
45- const sorter = sort ?? byDateAndAlphabetical ( cfg )
45+ const sorter = sort ?? byAlphabetical ( cfg )
4646 let list = allFiles . sort ( sorter )
4747 if ( limit ) {
4848 list = list . slice ( 0 , limit )
0 commit comments