We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba7d678 commit 3bb48c9Copy full SHA for 3bb48c9
source/js/umami-view.js
@@ -94,6 +94,8 @@ let viewCtn = document.querySelector("#umami-page-views-container");
94
// 如果页面容器存在,则获取页面浏览量
95
if (viewCtn) {
96
let path = window.location.pathname;
97
- let target = decodeURI(path.replace(/\/*(index.html)?$/, "/"));
+ let target = path
98
+ .replace(/(\/[^/]+\.html)\/$/, "$1") // 如果是 /xxx.html/ 则去掉最后那个 /
99
+ .replace(/\/index\.html$/, "/"); // 如果是 /index.html 则归一成 /
100
pageStats(target);
101
}
0 commit comments