Skip to content

Commit

Permalink
fix popover regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Jan 10, 2022
1 parent d46e223 commit 54e3e07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
baseURL = "https://quartz.jzhao.xyz/"
#baseURL = "https://jackyzha0.github.io/quartz/"
languageCode = "en-us"
googleAnalytics = "G-XYFD95KB4J"
pygmentsUseClasses = true
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 54e3e07

Please sign in to comment.