:sparkles:🎉 Add waline3 comment plugin.

This commit is contained in:
elkan1788
2024-08-03 18:56:01 +08:00
parent 1076ba9282
commit 27ca39f39e
16 changed files with 351 additions and 72 deletions

View File

@@ -0,0 +1 @@
<div class="waline3-container"></div>

View File

@@ -8,11 +8,24 @@
}}
{{/* Append waline pageview & comment plugin */}}
{{ if or (eq .Site.Params.postMeta.views.plugin "waline") (eq .Site.Params.postMeta.comments.plugin "waline") }}
{{ $counter := dict
"js" .Site.Data.resources.plugins.waline.js
}}
{{ $pageCfg = merge $pageCfg (dict "waline" $counter) }}
{{ with .Site.Params.postMeta.views }}
{{ if and .enable (ne .plugin "busuanzi") }}
{{ $plugin := .plugin }}
{{ $counter := dict
"pagecnt" (index ($.Site.Data.resources.plugins) $plugin "js" 0)
}}
{{ $pageCfg = merge $pageCfg (dict $plugin $counter) }}
{{ end }}
{{ end }}
{{ with .Site.Params.postMeta.comments }}
{{ if .enable }}
{{ $plugin := .plugin }}
{{ $counter := dict
"commentcnt" (index ($.Site.Data.resources.plugins) $plugin "js" 1)
}}
{{ $pageCfg = merge $pageCfg (dict $plugin $counter) }}
{{ end }}
{{ end }}
{{/* Append mermaid plugin */}}

View File

@@ -100,6 +100,15 @@
{{ $config = merge $config (dict "waline" $waline) }}
{{ end }}
{{ with .Site.Params.waline3 }}
{{ $waline := dict
"js" $.Site.Data.resources.waline3.js
"css" $.Site.Data.resources.waline3.css
"cfg" .
}}
{{ $config = merge $config (dict "waline3" $waline) }}
{{ end }}
{{ with .Site.Params.giscus }}
{{ $giscus := dict
"js" $.Site.Data.resources.giscus.js

View File

@@ -1,5 +1,5 @@
{{ if .Site.Params.postMeta.views.enable }}
{{ $pageViewId := "" }}
{{ $pageViewId := "pageview-count" }}
{{ if eq .Site.Params.postMeta.views.plugin "leancloud" }}
{{ $pageViewId = "leancloud-visitors-count" }}
{{ else if eq .Site.Params.postMeta.views.plugin "busuanzi" }}
@@ -12,7 +12,7 @@
<span class="post-meta-item-text">
{{ print (T "PostMeta.views") (T "Symbol.colon") }}
</span>
<span {{ with $pageViewId }}id="{{ . }}"{{end}} {{ if eq .Site.Params.postMeta.views.plugin "waline" }}class="waline-pageview-count"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<span {{ with $pageViewId }}id="{{ . }}"{{end}} data-path="{{ .RelPermalink | relLangURL }}">
<i class="fa fa-sync fa-spin"></i>
</span>
</span>

View File

@@ -47,12 +47,16 @@
{{/* Comments scripts */}}
{{ if isset .Site.Params "waline" }}
{{ $walinejs := resources.Get "js/third-party/comments/waline.js" }}
{{ $nextjs = $nextjs | append $walinejs }}
{{ $walinejs := resources.Get "js/third-party/comments/waline.js" }}
{{ $nextjs = $nextjs | append $walinejs }}
{{ end }}
{{ if isset .Site.Params "waline3" }}
{{ $walinejs3 := resources.Get "js/third-party/comments/waline3.js" }}
{{ $nextjs = $nextjs | append $walinejs3 }}
{{ end }}
{{ if or .Site.Params.postMeta.views.enable .Site.Params.postMeta.comments.enable }}
{{ $counterjs := resources.Get "js/third-party/others/counter.js" }}
{{ $nextjs = $nextjs | append $counterjs }}
{{ end }}
{{ end }}
{{ if isset .Site.Params "giscus" }}
{{ $giscusjs := resources.Get "js/third-party/comments/giscus.js" }}