From e1f12e6cb7ec5d2bfc430c15319d14c6d87a2c70 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 31 Jan 2024 17:55:23 +0000
Subject: [PATCH] fix(style): search preview consistency
---
quartz/plugins/transformers/ofm.ts | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 8c405bf..d58eaf6 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -290,8 +290,9 @@
}
tag = slugTag(tag)
- if (file.data.frontmatter?.tags?.includes(tag)) {
- file.data.frontmatter.tags.push(tag)
+ if (file.data.frontmatter) {
+ const noteTags = file.data.frontmatter.tags ?? []
+ file.data.frontmatter.tags = [...new Set([...noteTags, tag])]
}
return {
--
Gitblit v1.10.0