mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-30 04:23:30 +08:00
switch to jsDelivr
This commit is contained in:
parent
62b359699b
commit
e9c8b439a0
@ -1,25 +1,30 @@
|
|||||||
{{- with .Site.Params.comments.gitalk -}}
|
{{- with .Site.Params.comments.gitalk -}}
|
||||||
|
|
||||||
<div id="gitalk-container"></div>
|
<div id="gitalk-container"></div>
|
||||||
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
|
<link
|
||||||
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
rel="stylesheet"
|
||||||
<script src="https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.18.0/js/md5.js"></script>
|
href="https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.css"
|
||||||
|
/>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.18.0/js/md5.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
const gitalk = new Gitalk({
|
const gitalk = new Gitalk({
|
||||||
clientID: '{{- .clientID -}}',
|
clientID: "{{- .clientID -}}",
|
||||||
clientSecret: '{{- .clientSecret -}}',
|
clientSecret: "{{- .clientSecret -}}",
|
||||||
repo: '{{- .repo -}}',
|
repo: "{{- .repo -}}",
|
||||||
owner: '{{- .owner -}}',
|
owner: "{{- .owner -}}",
|
||||||
admin: ['{{- .admin -}}'],
|
admin: ["{{- .admin -}}"],
|
||||||
distractionFreeMode: false, // Facebook-like distraction free mode
|
distractionFreeMode: false, // Facebook-like distraction free mode
|
||||||
id: md5(location.pathname) // Max Location.pathname Legth:75 https://github.com/gitalk/gitalk/issues/102
|
id: md5(location.pathname), // Max Location.pathname Legth:75 https://github.com/gitalk/gitalk/issues/102
|
||||||
});
|
});
|
||||||
(function () {
|
(function () {
|
||||||
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
|
if (
|
||||||
document.getElementById('gitalk-container').innerHTML = 'Gitalk comments not available by default when the website is previewed locally.';
|
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1
|
||||||
|
) {
|
||||||
|
document.getElementById("gitalk-container").innerHTML =
|
||||||
|
"Gitalk comments not available by default when the website is previewed locally.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gitalk.render('gitalk-container');
|
gitalk.render("gitalk-container");
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user