From 54e722a55d58f4bab86184ffc970159628fa6967 Mon Sep 17 00:00:00 2001
From: freenandes <42041153+freenandes@users.noreply.github.com>
Date: Wed, 18 Oct 2023 02:43:41 +0000
Subject: [PATCH] docs: Update showcase.md (#540)
---
quartz/plugins/emitters/tagPage.tsx | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx
index 19e2906..6afde2f 100644
--- a/quartz/plugins/emitters/tagPage.tsx
+++ b/quartz/plugins/emitters/tagPage.tsx
@@ -6,12 +6,12 @@
import { ProcessedContent, defaultProcessedContent } from "../vfile"
import { FullPageLayout } from "../../cfg"
import {
- CanonicalSlug,
FilePath,
- ServerSlug,
+ FullSlug,
getAllSegmentPrefixes,
joinSegments,
-} from "../../path"
+ pathToRoot,
+} from "../../util/path"
import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout"
import { TagContent } from "../../components"
@@ -41,7 +41,7 @@
allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes),
)
// add base tag
- tags.add("")
+ tags.add("index")
const tagDescriptions: Record<string, ProcessedContent> = Object.fromEntries(
[...tags].map((tag) => {
@@ -49,7 +49,7 @@
return [
tag,
defaultProcessedContent({
- slug: joinSegments("tags", tag, "index") as ServerSlug,
+ slug: joinSegments("tags", tag) as FullSlug,
frontmatter: { title, tags: [] },
}),
]
@@ -59,7 +59,7 @@
for (const [tree, file] of content) {
const slug = file.data.slug!
if (slug.startsWith("tags/")) {
- const tag = joinSegments(slug.slice("tags/".length), "index")
+ const tag = slug.slice("tags/".length)
if (tags.has(tag)) {
tagDescriptions[tag] = [tree, file]
}
@@ -67,8 +67,8 @@
}
for (const tag of tags) {
- const slug = joinSegments("tags", tag) as CanonicalSlug
- const externalResources = pageResources(slug, resources)
+ const slug = joinSegments("tags", tag) as FullSlug
+ const externalResources = pageResources(pathToRoot(slug), resources)
const [tree, file] = tagDescriptions[tag]
const componentData: QuartzComponentProps = {
fileData: file.data,
--
Gitblit v1.10.0