mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-08 22:49:44 +00:00
feat: add gitalk (#51)
This commit is contained in:
parent
d7c6059a7a
commit
5f8b79f942
4 changed files with 61 additions and 1 deletions
|
@ -94,6 +94,8 @@ copyright = "" # default: author.name ↓ # 默认为下面配
|
||||||
fancyboxCss = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">'
|
fancyboxCss = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">'
|
||||||
gitmentJS = '<script src="https://cdn.jsdelivr.net/npm/gitment@0.0.3/dist/gitment.browser.min.js" crossorigin="anonymous"></script>'
|
gitmentJS = '<script src="https://cdn.jsdelivr.net/npm/gitment@0.0.3/dist/gitment.browser.min.js" crossorigin="anonymous"></script>'
|
||||||
gitmentCSS = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitment@0.0.3/style/default.min.css" crossorigin="anonymous">'
|
gitmentCSS = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitment@0.0.3/style/default.min.css" crossorigin="anonymous">'
|
||||||
|
gitalkJS = '<script src="https://cdn.jsdelivr.net/npm/gitalk@1.2.2/dist/gitalk.min.js" integrity="sha256-DcjhdbufsHMHflFjZtKNFnPKOAL2ybOxGcPOR4MtnJg=" crossorigin="anonymous"></script>'
|
||||||
|
gitalkCSS = '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1.2.2/dist/gitalk.css" integrity="sha256-rJVe5uyYRXdLM+Kkoj7JtN+9qI0bZTxkYTaNWODpg7U=" crossorigin="anonymous">'
|
||||||
|
|
||||||
[params.gitment] # Gitment is a comment system based on GitHub issues. see https://github.com/imsun/gitment
|
[params.gitment] # Gitment is a comment system based on GitHub issues. see https://github.com/imsun/gitment
|
||||||
owner = "" # Your GitHub ID
|
owner = "" # Your GitHub ID
|
||||||
|
@ -101,6 +103,12 @@ copyright = "" # default: author.name ↓ # 默认为下面配
|
||||||
clientId = "" # Your client ID
|
clientId = "" # Your client ID
|
||||||
clientSecret = "" # Your client secret
|
clientSecret = "" # Your client secret
|
||||||
|
|
||||||
|
[params.gitalk] # Gitalk is a comment system based on GitHub issues. see https://github.com/gitalk/gitalk
|
||||||
|
owner = "" # Your GitHub ID
|
||||||
|
repo = "" # The repo to store comments
|
||||||
|
clientId = "" # Your client ID
|
||||||
|
clientSecret = "" # Your client secret
|
||||||
|
|
||||||
[params.flowchartDiagrams]# see https://blog.olowolo.com/example-site/post/js-flowchart-diagrams/
|
[params.flowchartDiagrams]# see https://blog.olowolo.com/example-site/post/js-flowchart-diagrams/
|
||||||
enable = false
|
enable = false
|
||||||
options = ""
|
options = ""
|
||||||
|
|
|
@ -80,4 +80,30 @@
|
||||||
<noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>
|
<noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- end }}
|
<!-- 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 }}
|
||||||
|
|
7
static/lib/gitalk/gitalk-1.2.2.min.css
vendored
Normal file
7
static/lib/gitalk/gitalk-1.2.2.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
19
static/lib/gitalk/gitalk-1.2.2.min.js
vendored
Normal file
19
static/lib/gitalk/gitalk-1.2.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue