From c874e7e9378a5ba895870e9680484fb4af5c6e93 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 19 Aug 2023 22:52:25 +0000
Subject: [PATCH] base path refactor to better support subpath hosting
---
quartz/components/Backlinks.tsx | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/quartz/components/Backlinks.tsx b/quartz/components/Backlinks.tsx
index 8cf3afa..e88966b 100644
--- a/quartz/components/Backlinks.tsx
+++ b/quartz/components/Backlinks.tsx
@@ -1,9 +1,9 @@
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
import style from "./styles/backlinks.scss"
-import { canonicalizeServer, resolveRelative } from "../util/path"
+import { resolveRelative, simplifySlug } from "../util/path"
function Backlinks({ fileData, allFiles }: QuartzComponentProps) {
- const slug = canonicalizeServer(fileData.slug!)
+ const slug = simplifySlug(fileData.slug!)
const backlinkFiles = allFiles.filter((file) => file.links?.includes(slug))
return (
<div class="backlinks">
@@ -12,7 +12,7 @@
{backlinkFiles.length > 0 ? (
backlinkFiles.map((f) => (
<li>
- <a href={resolveRelative(slug, canonicalizeServer(f.slug!))} class="internal">
+ <a href={resolveRelative(fileData.slug!, f.slug!)} class="internal">
{f.frontmatter?.title}
</a>
</li>
--
Gitblit v1.10.0