From b44a79eebaf1664512ef5ff4e3246b3a6a416ff4 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 19 Dec 2023 19:40:59 +0000
Subject: [PATCH] fix: wikilinks should allow external links (closes #639)
---
quartz/plugins/emitters/tagPage.tsx | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx
index 54ad934..5669119 100644
--- a/quartz/plugins/emitters/tagPage.tsx
+++ b/quartz/plugins/emitters/tagPage.tsx
@@ -5,7 +5,13 @@
import { pageResources, renderPage } from "../../components/renderPage"
import { ProcessedContent, defaultProcessedContent } from "../vfile"
import { FullPageLayout } from "../../cfg"
-import { FilePath, FullSlug, getAllSegmentPrefixes, joinSegments } from "../../util/path"
+import {
+ FilePath,
+ FullSlug,
+ getAllSegmentPrefixes,
+ joinSegments,
+ pathToRoot,
+} from "../../util/path"
import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout"
import { TagContent } from "../../components"
@@ -34,12 +40,13 @@
const tags: Set<string> = new Set(
allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes),
)
+
// add base tag
tags.add("index")
const tagDescriptions: Record<string, ProcessedContent> = Object.fromEntries(
[...tags].map((tag) => {
- const title = tag === "" ? "Tag Index" : `Tag: #${tag}`
+ const title = tag === "index" ? "Tag Index" : `Tag: #${tag}`
return [
tag,
defaultProcessedContent({
@@ -62,7 +69,7 @@
for (const tag of tags) {
const slug = joinSegments("tags", tag) as FullSlug
- const externalResources = pageResources(slug, resources)
+ const externalResources = pageResources(pathToRoot(slug), resources)
const [tree, file] = tagDescriptions[tag]
const componentData: QuartzComponentProps = {
fileData: file.data,
--
Gitblit v1.10.0