Jacky Zhao
2023-11-11 f67356c3d2d609a8a6b674ac650fc41d6dfb4cc7
quartz/components/Explorer.tsx
@@ -15,7 +15,12 @@
  sortFn: (a, b) => {
    // Sort order: folders first, then files. Sort folders and files alphabetically
    if ((!a.file && !b.file) || (a.file && b.file)) {
      return a.displayName.localeCompare(b.displayName)
      // numeric: true: Whether numeric collation should be used, such that "1" < "2" < "10"
      // sensitivity: "base": Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A
      return a.displayName.localeCompare(b.displayName, undefined, {
        numeric: true,
        sensitivity: "base",
      })
    }
    if (a.file && !b.file) {
      return 1
@@ -81,7 +86,7 @@
  function Explorer({ allFiles, displayClass, fileData }: QuartzComponentProps) {
    constructFileTree(allFiles)
    return (
      <div class={`explorer ${displayClass}`}>
      <div class={`explorer ${displayClass ?? ""}`}>
        <button
          type="button"
          id="explorer"