diff options
author | 赵志远 <shetu2008@163.com> | 2018-04-05 21:44:09 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-04-05 21:44:09 +0800 |
commit | 5f8b79f942f94da8954d8c28c8704aa5af045a54 (patch) | |
tree | b2e3cbbd4791d4cbf360b42a1b901d0839177259 /layouts | |
parent | d7c6059a7a5ac6ab3d319adff94b67a1125d6e3d (diff) |
feat: add gitalk (#51)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/comments.html | 28 |
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 }} |