There was an error while loading. Please reload this page.
1 parent f73d039 commit e47408aCopy full SHA for e47408a
1 file changed
docs/assets/js/giscus.js
@@ -30,8 +30,7 @@ const giscusPlugin = (hook, vm) => {
30
const setupGiscusTerm = (iframe) => {
31
// Replace `term` parameter in iframe src.
32
const src = iframe.getAttribute('src')
33
- let term = decodeURIComponent(location.hash).replace('#', '')
34
- if (!term) term = '/'
+ const term = document.body.getAttribute('data-page').replace(/\.\w+$/, '')
35
const newSrc = src.replace(/term=[^&]*/, `term=${encodeURIComponent(term)}`)
36
iframe.setAttribute('src', newSrc)
37
}
0 commit comments