From 505673acd71e6b023abae19c706a736b257cff2a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 03 Sep 2023 01:07:26 +0000
Subject: [PATCH] feat: pluralize things in lists
---
quartz/components/pages/TagContent.tsx | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx
index fb72e28..9907e3f 100644
--- a/quartz/components/pages/TagContent.tsx
+++ b/quartz/components/pages/TagContent.tsx
@@ -6,6 +6,7 @@
import { FullSlug, getAllSegmentPrefixes, simplifySlug } from "../../util/path"
import { QuartzPluginData } from "../../plugins/vfile"
import { Root } from "hast"
+import { pluralize } from "../../util/lang"
const numPages = 10
function TagContent(props: QuartzComponentProps) {
@@ -60,7 +61,7 @@
</h2>
{content && <p>{content}</p>}
<p>
- {pages.length} items with this tag.{" "}
+ {pluralize(pages.length, "item")} with this tag.{" "}
{pages.length > numPages && `Showing first ${numPages}.`}
</p>
<PageList limit={numPages} {...listProps} />
@@ -80,7 +81,7 @@
return (
<div class="popover-hint">
<article>{content}</article>
- <p>{pages.length} items with this tag.</p>
+ <p>{pluralize(pages.length, "item")} with this tag.</p>
<div>
<PageList {...listProps} />
</div>
--
Gitblit v1.10.0