From 2417effc05f4a561f6f6fe1e0f7c416920e2aad8 Mon Sep 17 00:00:00 2001 From: Dillon Date: Tue, 11 Feb 2020 21:10:09 +0800 Subject: [PATCH] feat(comments): improve comments and add valine config meta --- exampleSite/config.toml | 4 +- exampleSite/zh/config.toml | 4 +- layouts/partials/comments.html | 112 ++++++++++++++++----------------- 3 files changed, 59 insertions(+), 61 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index c11d145..9e8cd1e 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -306,10 +306,12 @@ dateFormatToUse = "2006-01-02" enable = false appId = "" appKey = "" + placeholder = "Your comment ..." notify = false verify = true avatar = "mp" - placeholder = "Your comment ..." + #meta= "" + pageSize = 10 visitor = true recordIP = true diff --git a/exampleSite/zh/config.toml b/exampleSite/zh/config.toml index d84263b..48c5e47 100644 --- a/exampleSite/zh/config.toml +++ b/exampleSite/zh/config.toml @@ -306,10 +306,12 @@ dateFormatToUse = "2006-01-02" enable = false appId = "" appKey = "" + placeholder = "你的评论 ..." notify = false verify = true avatar = "mp" - placeholder = "你的评论 ..." + #meta= "" + pageSize = 10 visitor = true recordIP = true diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 005f1f5..ed0a59b 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,25 +1,14 @@ {{- if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}} {{- /* Disqus Comment System */ -}} - {{- if .Site.Params.disqus.shortname -}} + {{- with .Site.Params.disqus.shortname -}}
- + {{- end -}} {{- /* Gitalk Comment System */ -}} {{- if .Site.Params.gitalk.owner -}} -
+
{{- if .Site.Params.cdn.gitalk_css -}} {{- .Site.Params.cdn.gitalk_css | safeHTML -}} {{- else -}} @@ -32,57 +21,62 @@ {{- $res := resources.Get "js/lib/gitalk/gitalk.min.js" | resources.Minify -}} {{- end -}} - {{- end -}} {{- /* Valine Comment System */ -}} {{- if .Site.Params.valine.enable -}} -
+
{{- if .Site.Params.cdn.valine_js -}} {{- .Site.Params.cdn.valine_js | safeHTML -}} {{- else -}} {{- $res := resources.Get "js/lib/valine/Valine.min.js" | resources.Minify -}} {{- end -}} - {{- end -}} @@ -90,18 +84,18 @@ {{- /* Facebook Comment System */ -}} {{- if .Site.Params.facebook.enable -}}
-
+ {{- end -}} {{- end -}}