From 50a18709e34ba5469b2c1781e580bbd14fefbefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Mon, 27 Jun 2022 15:20:45 +0800 Subject: [PATCH] :construction: add Artalk comment support. --- exampleSite/config.yaml | 6 +++++ .../partials/_thirdparty/comment/artalk.html | 22 +++++++++++++++++++ .../partials/_thirdparty/comment/waline.html | 22 ++++++++++--------- 3 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 layouts/partials/_thirdparty/comment/artalk.html diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 4f331b5..6f96d14 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -740,6 +740,12 @@ params: requiredMeta: ['nick', 'mail'] serverURL: # + artalk: + enable: true + site: "默认站点" + placeholder: "请文明发言,谢谢!" + server: # + # Disqus # For more information: https://disqus.com disqus: diff --git a/layouts/partials/_thirdparty/comment/artalk.html b/layouts/partials/_thirdparty/comment/artalk.html new file mode 100644 index 0000000..7787d7e --- /dev/null +++ b/layouts/partials/_thirdparty/comment/artalk.html @@ -0,0 +1,22 @@ +{{- if .Site.Params.artalk.enable }} +{{- with .Site.Params.artalk }} + + + + +
+ + +{{- end }} +{{- end }} + diff --git a/layouts/partials/_thirdparty/comment/waline.html b/layouts/partials/_thirdparty/comment/waline.html index c67018e..ff07bb6 100644 --- a/layouts/partials/_thirdparty/comment/waline.html +++ b/layouts/partials/_thirdparty/comment/waline.html @@ -1,3 +1,4 @@ +{{- if .Site.Params.waline.enable }} {{- with .Site.Params.waline }}
@@ -9,15 +10,16 @@ }; Waline.init({ locale, - el: "#waline", - pageview: {{ .pageView }}, - emoji: {{ .emoji }}, - imageUploader: {{ .imgUploader }}, - wordLimit: {{ .wordLimit }}, - requiredMeta: {{ .requiredMeta }}, - serverURL: "{{ .serverURL }}", - lang: "{{ $.Lang }}", - dark: "auto" + el : "#waline", + pageview : {{ .pageView }}, + emoji : {{ .emoji }}, + imageUploader : {{ .imgUploader }}, + wordLimit : {{ .wordLimit }}, + requiredMeta : {{ .requiredMeta }}, + serverURL : "{{ .serverURL }}", + lang : "{{ $.Lang }}", + dark : "auto" }); -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} \ No newline at end of file