From 3ac6b42e16dca5a44ed3fec2c0314f1dbbc2322b Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 16 Jul 2023 06:02:12 +0000
Subject: [PATCH] finish path refactoring, add sourcemap + better trace support

---
 quartz/components/TagList.tsx |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/quartz/components/TagList.tsx b/quartz/components/TagList.tsx
index 65286a5..54147db 100644
--- a/quartz/components/TagList.tsx
+++ b/quartz/components/TagList.tsx
@@ -1,17 +1,17 @@
-import { resolveToRoot } from "../path"
+import { canonicalizeServer, pathToRoot } from "../path"
 import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
 import { slug as slugAnchor } from 'github-slugger'
 
 function TagList({ fileData }: QuartzComponentProps) {
   const tags = fileData.frontmatter?.tags
-  const slug = fileData.slug!
-  const baseDir = resolveToRoot(slug)
+  const slug = canonicalizeServer(fileData.slug!)
+  const baseDir = pathToRoot(slug)
   if (tags && tags.length > 0) {
     return <ul class="tags">{tags.map(tag => {
       const display = `#${tag}`
       const linkDest = baseDir + `/tags/${slugAnchor(tag)}`
       return <li>
-        <a href={linkDest}>{display}</a>
+        <a href={linkDest} class="internal">{display}</a>
       </li>
     })}</ul>
   } else {
@@ -25,17 +25,19 @@
   display: flex;
   padding-left: 0;
   gap: 0.4rem;
+}
+  
+.tags > li {
+  display: inline-block;
+  white-space: nowrap;
+  margin: 0;
+  overflow-wrap: normal;
+}
 
-  & > li {
-    display: inline-block;
-    margin: 0;
-
-    & > a {
-      border-radius: 8px;
-      border: var(--lightgray) 1px solid;
-      padding: 0.2rem 0.5rem;
-    }
-  }
+.tags > li > a {
+  border-radius: 8px;
+  background-color: var(--highlight);
+  padding: 0.2rem 0.5rem;
 }
 `
 

--
Gitblit v1.10.0