:sparkles:🎉 Add waline3 comment plugin.
This commit is contained in:
1
layouts/partials/_thirdparty/comment/waline3.html
vendored
Normal file
1
layouts/partials/_thirdparty/comment/waline3.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<div class="waline3-container"></div>
|
||||
@@ -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 */}}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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" }}
|
||||
|
||||
Reference in New Issue
Block a user