From 9106a1605f922cc4533a9e0cf5115296b7882fcb Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 10 Jan 2022 09:00:45 -0800 Subject: [PATCH] fix popover regex --- config.toml | 1 - layouts/partials/popover.html | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index 656b1c4c..01d8d3d8 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,4 @@ baseURL = "https://quartz.jzhao.xyz/" -#baseURL = "https://jackyzha0.github.io/quartz/" languageCode = "en-us" googleAnalytics = "G-XYFD95KB4J" pygmentsUseClasses = true diff --git a/layouts/partials/popover.html b/layouts/partials/popover.html index 951f1356..3a7de110 100644 --- a/layouts/partials/popover.html +++ b/layouts/partials/popover.html @@ -7,10 +7,11 @@ return template.content.firstChild } - const pathRegex = /\.\.(\/\.\.)*/ + const pathRegex = /\.\.?(\/\.\.)*/ document.addEventListener("DOMContentLoaded", () => { [...document.getElementsByClassName("internal-link")] .forEach(li => { + console.log(li.dataset.src.replace(pathRegex, '')) const linkDest = content[li.dataset.src.replace(pathRegex, '')] if (linkDest) { const popoverElement = `