From 6f9a29c174f8657a90d7dda8d39e933c220fa717 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 10 Jan 2022 16:49:29 +0000
Subject: [PATCH] various path fixes

---
 layouts/partials/popover.html |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/layouts/partials/popover.html b/layouts/partials/popover.html
index afcf4c5..951f135 100644
--- a/layouts/partials/popover.html
+++ b/layouts/partials/popover.html
@@ -7,10 +7,11 @@
     return template.content.firstChild
   }
 
+  const pathRegex = /\.\.(\/\.\.)*/
   document.addEventListener("DOMContentLoaded", () => {
     [...document.getElementsByClassName("internal-link")]
       .forEach(li => {
-        const linkDest = content[li.dataset.src]
+        const linkDest = content[li.dataset.src.replace(pathRegex, '')]
         if (linkDest) {
           const popoverElement = `<div class="popover">
     <h3>${linkDest.title}</h3>

--
Gitblit v1.10.0