From cbae88fc4e9b98764cfccca2e85f265c4b894573 Mon Sep 17 00:00:00 2001
From: Adam Brangenberg <adambrangenberg@proton.me>
Date: Mon, 31 Jul 2023 04:08:32 +0000
Subject: [PATCH] Removing redundant properties (#356)
---
quartz/plugins/transformers/ofm.ts | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index 36e79b0..4a45b02 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -9,7 +9,7 @@
import { JSResource } from "../../resources"
// @ts-ignore
import calloutScript from "../../components/scripts/callout.inline.ts"
-import { FilePath, canonicalizeServer, pathToRoot, slugifyFilePath } from "../../path"
+import { FilePath, canonicalizeServer, pathToRoot, slugTag, slugifyFilePath } from "../../path"
export interface Options {
comments: boolean
@@ -331,9 +331,13 @@
const slug = canonicalizeServer(file.data.slug!)
const base = pathToRoot(slug)
findAndReplace(tree, tagRegex, (value: string, tag: string) => {
+ if (file.data.frontmatter) {
+ file.data.frontmatter.tags.push(tag)
+ }
+
return {
type: "link",
- url: base + `/tags/${slugAnchor(tag)}`,
+ url: base + `/tags/${slugTag(tag)}`,
data: {
hProperties: {
className: ["tag-link"],
--
Gitblit v1.10.0