Skip to content

Commit e47408a

Browse files
committed
(giscus) fixed term issue
1 parent f73d039 commit e47408a

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').replace(/\.\w+$/, '')
3534
const newSrc = src.replace(/term=[^&]*/, `term=${encodeURIComponent(term)}`)
3635
iframe.setAttribute('src', newSrc)
3736
}

0 commit comments

Comments
 (0)