aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
author赵志远 <shetu2008@163.com>2018-04-05 21:44:09 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-04-05 21:44:09 +0800
commit5f8b79f942f94da8954d8c28c8704aa5af045a54 (patch)
treeb2e3cbbd4791d4cbf360b42a1b901d0839177259 /layouts
parentd7c6059a7a5ac6ab3d319adff94b67a1125d6e3d (diff)
feat: add gitalk (#51)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/comments.html28
1 files changed, 27 insertions, 1 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index eb75615..440240a 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -80,4 +80,30 @@
<noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>
{{- end }}
-{{- end }} \ No newline at end of file
+ <!-- gitalk -->
+ {{- if .Site.Params.gitalk.owner -}}
+ <div id="gitalk-container"></div>
+ {{ if .Site.Params.publicCDN.enable -}}
+ {{ .Site.Params.publicCDN.gitalkCSS | safeHTML }}
+ {{ .Site.Params.publicCDN.gitalkJS | safeHTML }}
+ {{- else -}}
+ <link rel="stylesheet" href="{{ "lib/gitalk/gitalk-1.2.2.min.css" | relURL }}">
+ <script src="{{ "lib/gitalk/gitalk-1.2.2.min.js" | relURL }}"></script>
+ {{- end }}
+ <script type="text/javascript">
+ var gitalk = new Gitalk({
+ id: '{{ .Date }}',
+ title: '{{ .Title }}',
+ clientID: '{{ .Site.Params.gitalk.clientId }}',
+ clientSecret: '{{ .Site.Params.gitalk.clientSecret }}',
+ repo: '{{ .Site.Params.gitalk.repo }}',
+ owner: '{{ .Site.Params.gitalk.owner }}',
+ admin: ['{{ .Site.Params.gitalk.owner }}'],
+ body: decodeURI(location.href)
+ });
+ gitalk.render('gitalk-container');
+ </script>
+ <noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript>
+ {{- end }}
+
+{{- end }}