From 422ba5c36586c7ebc31141da8bb539b4157aa01a Mon Sep 17 00:00:00 2001
From: Yuto Nagata <38714187+mouse484@users.noreply.github.com>
Date: Sat, 16 Sep 2023 02:17:20 +0000
Subject: [PATCH] fix: umami analytics date attribute (#477)

---
 quartz/components/pages/FolderContent.tsx |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx
index 1528aea..a766d4b 100644
--- a/quartz/components/pages/FolderContent.tsx
+++ b/quartz/components/pages/FolderContent.tsx
@@ -7,12 +7,13 @@
 import { PageList } from "../PageList"
 import { _stripSlashes, simplifySlug } from "../../util/path"
 import { Root } from "hast"
+import { pluralize } from "../../util/lang"
 
 function FolderContent(props: QuartzComponentProps) {
   const { tree, fileData, allFiles } = props
   const folderSlug = _stripSlashes(simplifySlug(fileData.slug!))
   const allPagesInFolder = allFiles.filter((file) => {
-    const fileSlug = simplifySlug(file.slug!)
+    const fileSlug = _stripSlashes(simplifySlug(file.slug!))
     const prefixed = fileSlug.startsWith(folderSlug) && fileSlug !== folderSlug
     const folderParts = folderSlug.split(path.posix.sep)
     const fileParts = fileSlug.split(path.posix.sep)
@@ -33,8 +34,10 @@
 
   return (
     <div class="popover-hint">
-      <article>{content}</article>
-      <p>{allPagesInFolder.length} items under this folder.</p>
+      <article>
+        <p>{content}</p>
+      </article>
+      <p>{pluralize(allPagesInFolder.length, "item")} under this folder.</p>
       <div>
         <PageList {...listProps} />
       </div>

--
Gitblit v1.10.0