From efed544df14c54ee8a0f81079e326a8bf2255fe3 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@elliehuxtable.com>
Date: Tue, 06 Aug 2024 01:43:57 +0000
Subject: [PATCH] docs: Add "Ellie's Notes" to the showcase (#1315)
---
quartz/plugins/transformers/links.ts | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts
index 2d43be1..2805818 100644
--- a/quartz/plugins/transformers/links.ts
+++ b/quartz/plugins/transformers/links.ts
@@ -8,6 +8,7 @@
simplifySlug,
splitAnchor,
transformLink,
+ joinSegments,
} from "../../util/path"
import path from "path"
import { visit } from "unist-util-visit"
@@ -92,7 +93,7 @@
}
node.properties.className = classes
- if (opts.openLinksInNewTab) {
+ if (isExternal && opts.openLinksInNewTab) {
node.properties.target = "_blank"
}
@@ -107,7 +108,7 @@
// url.resolve is considered legacy
// WHATWG equivalent https://nodejs.dev/en/api/v18/url/#urlresolvefrom-to
- const url = new URL(dest, `https://base.com/${curSlug}`)
+ const url = new URL(dest, "https://base.com/" + stripSlashes(curSlug, true))
const canonicalDest = url.pathname
let [destCanonical, _destAnchor] = splitAnchor(canonicalDest)
if (destCanonical.endsWith("/")) {
--
Gitblit v1.10.0