From 0df36e86dab038569301fe01326901ce856bf3fb Mon Sep 17 00:00:00 2001
From: Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Date: Sat, 21 Nov 2026 08:12:17 +0000
Subject: [PATCH] fix(i18n): use the singular unit in the English reading time
---
tests/fixtures/reading-time/reading-time.test.mjs | 23 +++++++++++++++++++++++
i18n/en.toml | 2 +-
tests/fixtures/reading-time/content/posts/short.md | 5 +++++
tests/fixtures/reading-time/hugo.toml | 6 ++++++
tests/fixtures/reading-time/content/posts/long.md | 5 +++++
5 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/i18n/en.toml b/i18n/en.toml
index 61c1c80..f15650b 100644
--- a/i18n/en.toml
+++ b/i18n/en.toml
@@ -45,7 +45,7 @@
[readingTime]
one = "One minute read"
-other = "{{ .Count }} minutes read"
+other = "{{ .Count }} minute read"
[wordCount]
one = "One word"
diff --git a/tests/fixtures/reading-time/content/posts/long.md b/tests/fixtures/reading-time/content/posts/long.md
new file mode 100644
index 0000000..0574d55
--- /dev/null
+++ b/tests/fixtures/reading-time/content/posts/long.md
@@ -0,0 +1,5 @@
+---
+title: Long post
+---
+
+word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word
diff --git a/tests/fixtures/reading-time/content/posts/short.md b/tests/fixtures/reading-time/content/posts/short.md
new file mode 100644
index 0000000..9f88d0c
--- /dev/null
+++ b/tests/fixtures/reading-time/content/posts/short.md
@@ -0,0 +1,5 @@
+---
+title: Short post
+---
+
+Word.
diff --git a/tests/fixtures/reading-time/hugo.toml b/tests/fixtures/reading-time/hugo.toml
new file mode 100644
index 0000000..6474186
--- /dev/null
+++ b/tests/fixtures/reading-time/hugo.toml
@@ -0,0 +1,6 @@
+title = "Reading time fixture"
+theme = "ananke"
+
+[params]
+show_reading_time = true
+reading_speed = 100 # words per minute, so the fixture word counts give exact minutes
diff --git a/tests/fixtures/reading-time/reading-time.test.mjs b/tests/fixtures/reading-time/reading-time.test.mjs
new file mode 100644
index 0000000..436af93
--- /dev/null
+++ b/tests/fixtures/reading-time/reading-time.test.mjs
@@ -0,0 +1,23 @@
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { test } from "node:test";
+import { fileURLToPath } from "node:url";
+import { load } from "cheerio";
+import { buildFixtureSite } from "../../support/prepare-site.mjs";
+
+const source = dirname(fileURLToPath(import.meta.url));
+
+function readingTime(output, path) {
+ const $ = load(readFileSync(join(output, path), "utf8"));
+ return $("article header span.f6.tracked").first().text().trim();
+}
+
+test("reading time uses the singular unit as a compound adjective (#870)", () => {
+ const output = buildFixtureSite({ source });
+ assert.equal(
+ readingTime(output, "posts/short/index.html"),
+ "- One minute read",
+ );
+ assert.equal(readingTime(output, "posts/long/index.html"), "- 3 minute read");
+});
--
Gitblit v1.10.0