Skip to content

Commit 96c7f6b

Browse files
committed
add pv stats
1 parent 6431d49 commit 96c7f6b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

layouts/post.shtml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,26 @@
1212
<ctx :if="$page.custom.getOr('mermaid', false)">
1313
<script defer src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/mermaid/8.14.0/mermaid.min.js" onload="mermaid.initialize({startOnLoad:true});"></script>
1414
</ctx>
15+
<script>
16+
var _hmt = _hmt || [];
17+
(function() {
18+
var hm = document.createElement("script");
19+
hm.src = "https://hm.baidu.com/hm.js?c7ddb41bcae30e6c2acc86e2cbe8b753";
20+
var s = document.getElementsByTagName("script")[0];
21+
s.parentNode.insertBefore(hm, s);
22+
})();
23+
24+
const payload = {
25+
'ns': 'zigcc',
26+
'url': document.location.href,
27+
'title': document.title,
28+
'referrer': window.frames.top.document.referrer,
29+
};
30+
fetch('https://en.liujiacai.net/pv/write?' + new URLSearchParams(payload),
31+
{mode: 'no-cors'}).catch(console.log);
32+
</script>
33+
1534
</head>
1635
<body id="body">
1736
<div :html="$page.content()"></div>
18-
</body>
37+
</body>

0 commit comments

Comments
 (0)