From a7e20804f5fe68dff7b71f3065f60e2147d633ba Mon Sep 17 00:00:00 2001
From: Sam Stokes <me@samstokes.co.uk>
Date: Tue, 05 Dec 2023 02:18:47 +0000
Subject: [PATCH] feat: Support space-delimited tags in `FrontMatter` transformer (#620)
---
quartz/plugins/emitters/contentIndex.ts | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts
index 69d0d37..c5170c6 100644
--- a/quartz/plugins/emitters/contentIndex.ts
+++ b/quartz/plugins/emitters/contentIndex.ts
@@ -59,6 +59,17 @@
</item>`
const items = Array.from(idx)
+ .sort(([_, f1], [__, f2]) => {
+ if (f1.date && f2.date) {
+ return f2.date.getTime() - f1.date.getTime()
+ } else if (f1.date && !f2.date) {
+ return -1
+ } else if (!f1.date && f2.date) {
+ return 1
+ }
+
+ return f1.title.localeCompare(f2.title)
+ })
.map(([slug, content]) => createURLEntry(simplifySlug(slug), content))
.slice(0, limit ?? idx.size)
.join("")
--
Gitblit v1.10.0