Skip to content

Commit 1c97b92

Browse files
committed
(giscus) replaced term with value of data-page
1 parent e9ce245 commit 1c97b92

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

docs/assets/js/giscus.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const giscusPlugin = (hook, vm) => {
3030
const setupGiscusTerm = (iframe) => {
3131
// Replace `term` parameter in iframe src.
3232
const src = iframe.getAttribute('src')
33-
let term = decodeURIComponent(location.hash).replace('#', '')
34-
if (!term) term = '/'
33+
const term = document.body.getAttribute('data-page')
3534
const newSrc = src.replace(/term=[^&]*/, `term=${encodeURIComponent(term)}`)
3635
iframe.setAttribute('src', newSrc)
3736
}

0 commit comments

Comments
 (0)