fix popover regex

This commit is contained in:
Jacky Zhao 2022-01-10 09:00:45 -08:00
parent 1f3cad2afa
commit 9106a1605f
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,4 @@
baseURL = "https://quartz.jzhao.xyz/"
#baseURL = "https://jackyzha0.github.io/quartz/"
languageCode = "en-us"
googleAnalytics = "G-XYFD95KB4J"
pygmentsUseClasses = true

View File

@ -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 = `<div class="popover">