There was an error while loading. Please reload this page.
term
data-page
1 parent e9ce245 commit 1c97b92Copy full SHA for 1c97b92
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')
35
const newSrc = src.replace(/term=[^&]*/, `term=${encodeURIComponent(term)}`)
36
iframe.setAttribute('src', newSrc)
37
}
0 commit comments