From 9969bc696755c23fdeda468f8f6790d9c44251a8 Mon Sep 17 00:00:00 2001 From: Giuseppe Pignataro Date: Fri, 15 Mar 2019 10:15:32 +0100 Subject: Added gitalk comment system --- exampleSite/config.toml | 7 ++++++- layouts/_default/single.html | 4 +--- layouts/partials/comments.html | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 layouts/partials/comments.html diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 595cde4..37c3712 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -130,4 +130,9 @@ copyright = "This work is licensed under a Creative Commons Attribution-NonComme url = "cover.png" width = 800 height = 600 - + +[params.gitalk] +owner = "" +repo = "" +clientId = "" +clientSecret = "" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0dcadf8..a569fcf 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -103,9 +103,7 @@
{{ if ( .Params.showComments | default true ) }} - {{ if ne .Site.DisqusShortname "" }} - {{ template "_internal/disqus.html" . }} - {{ end }} + {{ partial "comments.html" . }} {{ end }}
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..2bce448 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,41 @@ +{{ if and .IsPage (ne .Params.comment false) -}} + + {{- if .Site.DisqusShortname -}} +
+ + + {{- end -}} + + + {{- if .Site.Params.gitalk.owner -}} +
+ + + + + {{- end }} + +{{- end }} \ No newline at end of file -- cgit v1.2.3