2022-06-05 16:14:17 +08:00
|
|
|
{{- $root := . -}}
|
|
|
|
{{- with .Site.Params.comments }}
|
|
|
|
{{- $tc := and .storage (gt (len .nav) 1) }}
|
|
|
|
{{- $active := .active }}
|
|
|
|
{{- $fc := .active }}
|
|
|
|
{{- $sc := "" }}
|
|
|
|
{{- $sn := "" }}
|
2022-09-25 21:40:36 +08:00
|
|
|
<div id="comments" class="post-comments">
|
2022-06-05 16:14:17 +08:00
|
|
|
<div class="comment-head">
|
|
|
|
<div class="comment-headline">
|
|
|
|
<i class="fas fa-comments fa-fw"></i>
|
|
|
|
<span>{{ T "PostCommentTitle" }}</span>
|
|
|
|
</div>
|
|
|
|
{{- if $tc }}
|
|
|
|
{{- $sn = (sort .nav "weight") }}
|
|
|
|
{{- $fc = index $sn 0 }}
|
|
|
|
{{- $sc = index $sn 1 }}
|
|
|
|
<div class="comment-switch">
|
|
|
|
<span class="first-comment">{{ $fc.title }}</span>
|
|
|
|
<span class="switch-btn {{ if eq .active (lower $sc.name) }}move{{ end }}"></span>
|
|
|
|
<span class="second-comment">{{ $sc.title }}</span>
|
|
|
|
</div>
|
|
|
|
{{- end }}
|
|
|
|
</div>
|
|
|
|
<div class="comment-wrap">
|
|
|
|
{{ $cp := "_thirdparty/comment/%s.html" }}
|
|
|
|
{{- if $tc }}
|
|
|
|
{{- range $sn }}
|
2022-06-05 21:35:40 +08:00
|
|
|
<div>
|
2022-06-20 10:58:16 +08:00
|
|
|
{{- partial "_thirdparty/comment/comm_loading.html" . }}
|
2022-06-05 16:14:17 +08:00
|
|
|
{{- partial (printf $cp (lower .name)) $root }}
|
|
|
|
</div>
|
|
|
|
{{- end }}
|
|
|
|
{{- else }}
|
2022-06-20 10:58:16 +08:00
|
|
|
<div>
|
|
|
|
{{- partial "_thirdparty/comment/comm_loading.html" . }}
|
|
|
|
{{- partial (printf $cp $fc) $root }}
|
|
|
|
</div>
|
2022-06-05 16:14:17 +08:00
|
|
|
{{- end }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{- end }}
|