mirror of
https://github.com/alrayyes/wiki.git
synced 2025-06-09 07:03:38 +00:00
feat: Allow custom sorting of FolderPage and TagPage (#1250)
This commit is contained in:
parent
596e06ab0e
commit
ea92ed4f45
5 changed files with 116 additions and 105 deletions
quartz/components/pages
|
@ -7,12 +7,14 @@ import { stripSlashes, simplifySlug } from "../../util/path"
|
|||
import { Root } from "hast"
|
||||
import { htmlToJsx } from "../../util/jsx"
|
||||
import { i18n } from "../../i18n"
|
||||
import { QuartzPluginData } from "../../plugins/vfile"
|
||||
|
||||
interface FolderContentOptions {
|
||||
/**
|
||||
* Whether to display number of folders
|
||||
*/
|
||||
showFolderCount: boolean
|
||||
sort?: (f1: QuartzPluginData, f2: QuartzPluginData) => number
|
||||
}
|
||||
|
||||
const defaultOptions: FolderContentOptions = {
|
||||
|
@ -37,6 +39,7 @@ export default ((opts?: Partial<FolderContentOptions>) => {
|
|||
const classes = ["popover-hint", ...cssClasses].join(" ")
|
||||
const listProps = {
|
||||
...props,
|
||||
sort: options.sort,
|
||||
allFiles: allPagesInFolder,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue