🚧 optimization comment system setting.

This commit is contained in:
凡梦星尘 2022-06-29 19:31:16 +08:00
parent b9cd603c04
commit dafea2e479
5 changed files with 26 additions and 12 deletions

View File

@ -125,14 +125,16 @@ $algolia_search_enable : {{ $P.algoliaSearch.enable }};
$local_search_enable : {{ $P.localSearch.enable }}; $local_search_enable : {{ $P.localSearch.enable }};
// Online IM // Online IM
$gitalk_enable : {{ $P.gitalk.enable }}; //$gitalk_enable : {{ $P.gitalk.enable }};
$gitalk_enable : false;
$gitter_enable : {{ $P.gitter.enable }}; $gitter_enable : {{ $P.gitter.enable }};
// Comment // Comment
$disqusjs_enable : {{ $P.disqusjs.enable }}; //$disqusjs_enable : {{ $P.disqusjs.enable }};
$livere_enable : {{ $P.livere.enable }}; $disqusjs_enable : false;
$utterances_enable : {{ $P.utterances.enable }}; $livere_enable : {{ isset $P.livere "uid" }};
$waline_enable : {{ $P.waline.enable }}; $utterances_enable : {{ isset $P.utterances "utterances" }};
$waline_enable : {{ isset $P.waline "serverurl" }};
{{- with .Site.Params.comments }} {{- with .Site.Params.comments }}
{{- $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }} {{- $tce := and (isset . "nav") (and .storage (gt (len .nav) 1)) }}
$two_comments_enable : {{ $tce }}; $two_comments_enable : {{ $tce }};

View File

@ -1,4 +1,3 @@
{{- if .Site.Params.artalk.enable }}
{{- with .Site.Params.artalk }} {{- with .Site.Params.artalk }}
<link href="//unpkg.com/artalk@2.3.4/dist/Artalk.css" rel="stylesheet"> <link href="//unpkg.com/artalk@2.3.4/dist/Artalk.css" rel="stylesheet">
<script src="//unpkg.com/artalk@2.3.4/dist/Artalk.js"></script> <script src="//unpkg.com/artalk@2.3.4/dist/Artalk.js"></script>
@ -18,5 +17,4 @@
}) })
</script> </script>
{{- end }} {{- end }}
{{- end }}

View File

@ -0,0 +1,18 @@
{{- with .Site.Params.giscus }}
<div class="giscus" style="position: relative;"></div>
<script src="https://giscus.app/client.js"
data-repo="{{ .repo }}"
data-repo-id="{{ .repoId }}"
data-category="{{ .category }}"
data-category-id="{{ .categoryId }}"
data-mapping="{{ .mapping }}"
data-reactions-enabled="0"
data-emit-metadata="1"
data-input-position="{{ .inputPosition }}"
data-theme="{{ .theme }}"
data-lang="{{ $.Site.LanguageCode }}"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>
{{- end }}

View File

@ -1,5 +1,4 @@
{{- with .Site.Params.utterances }} {{- with .Site.Params.utterances }}
{{- if .enable }}
<script src="https://utteranc.es/client.js" <script src="https://utteranc.es/client.js"
repo="{{ .repo }}" repo="{{ .repo }}"
issue-term="{{ .issueTerm }}" issue-term="{{ .issueTerm }}"
@ -8,4 +7,3 @@ crossorigin="anonymous"
theme="{{ .theme }}" async> theme="{{ .theme }}" async>
</script> </script>
{{- end }} {{- end }}
{{- end }}

View File

@ -1,4 +1,3 @@
{{- if .Site.Params.waline.enable }}
{{- with .Site.Params.waline }} {{- with .Site.Params.waline }}
<div id="waline"></div> <div id="waline"></div>
@ -21,5 +20,4 @@
dark : "auto" dark : "auto"
}); });
</script> </script>
{{- end }} {{- end }}
{{- end }}