diff options
author | Giuseppe Pignataro <rogepix@gmail.com> | 2019-08-21 00:15:51 +0300 |
---|---|---|
committer | Giuseppe Pignataro <rogepix@gmail.com> | 2019-08-21 00:15:51 +0300 |
commit | beae4bad3e382ba8b0a504142c4276373dee5c24 (patch) | |
tree | c7215f755e0bb17732d8a2af34b14b0792ff6f2e | |
parent | 30f38062633bdbc21ee0872ffd8bbee91a8c4a18 (diff) |
Added gitment comment system
Added gitment comment system
-rw-r--r-- | exampleSite/config.toml | 14 | ||||
-rw-r--r-- | layouts/partials/comments.html | 22 |
2 files changed, 32 insertions, 4 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 550adf9..8eaa503 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -161,10 +161,10 @@ copyright = "This work is licensed under a Creative Commons Attribution-NonComme height = 600 [params.gitalk] -owner = "" -repo = "" -clientId = "" -clientSecret = "" +owner = "" # Your GitHub ID +repo = "" # The repo to store comments +clientId = "" # Your client ID +clientSecret = "" # Your client secret [params.valine] enable = false @@ -180,3 +180,9 @@ clientSecret = "" owner = "" # Your GitHub ID repo = "" # The repo to store comments +[params.gitment] # Gitment is a comment system based on GitHub issues. see https://github.com/imsun/gitment + owner = "" # Your GitHub ID + repo = "" # The repo to store comments + clientId = "" # Your client ID + clientSecret = "" # Your client secret + diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index fa0f32c..f48cd70 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -76,5 +76,27 @@ <noscript>Please enable JavaScript to view the <a href="https://github.com/utterance">comments powered by utterances.</a></noscript> {{- end }} + <!-- gitment --> + {{- if .Site.Params.gitment.owner -}} + <div id="comments-gitment"></div> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.min.css" crossorigin="anonymous"> + <script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.min.js" crossorigin="anonymous"></script> + <script type="text/javascript"> + var gitment = new Gitment({ + id: '{{ .Date }}', + title: '{{ .Title }}', + link: decodeURI(location.href), + desc: '{{ .Summary }}', + owner: '{{ .Site.Params.gitment.owner }}', + repo: '{{ .Site.Params.gitment.repo }}', + oauth: { + client_id: '{{ .Site.Params.gitment.clientId }}', + client_secret: '{{ .Site.Params.gitment.clientSecret }}' + } + }); + gitment.render('comments-gitment'); + </script> + <noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript> + {{- end -}} {{- end }} |