From 51c434b33f86e1f6e48e620ad2b0c52336494531 Mon Sep 17 00:00:00 2001 From: qiwang067 Date: Sat, 15 May 2021 10:52:07 +0800 Subject: [PATCH] fix comments feature --- docs/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/index.html b/docs/index.html index 13d1c5c..fe29579 100644 --- a/docs/index.html +++ b/docs/index.html @@ -57,6 +57,12 @@ // facebook-like distraction free mode distractionFreeMode: false }) + // 监听URL中hash的变化,如果发现换了一个MD文件,那么刷新页面,解决整个网站使用一个gitalk评论issues的问题。 + window.onhashchange = function(event){ + if(event.newURL.split('?')[0] !== event.oldURL .split('?')[0]) { + location.reload() + } + }