2023-01-01 21:12:58 +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>
|
2023-01-02 20:08:48 +08:00
|
|
|
<span>{{ T "PostComments.title" }}</span>
|
2022-06-05 16:14:17 +08:00
|
|
|
</div>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ if $tc }}
|
|
|
|
{{ $sn = (sort .nav "weight") }}
|
|
|
|
{{ $fc = index $sn 0 }}
|
|
|
|
{{ $sc = index $sn 1 }}
|
2022-06-05 16:14:17 +08:00
|
|
|
<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>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ end }}
|
2022-06-05 16:14:17 +08:00
|
|
|
</div>
|
|
|
|
<div class="comment-wrap">
|
|
|
|
{{ $cp := "_thirdparty/comment/%s.html" }}
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ if $tc }}
|
|
|
|
{{ range $sn }}
|
2022-06-05 21:35:40 +08:00
|
|
|
<div>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ partial "_thirdparty/comment/comm_loading.html" . }}
|
|
|
|
{{ partial (printf $cp (lower .name)) $root }}
|
2022-06-05 16:14:17 +08:00
|
|
|
</div>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ end }}
|
|
|
|
{{ else }}
|
2022-06-20 10:58:16 +08:00
|
|
|
<div>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ partial "_thirdparty/comment/comm_loading.html" . }}
|
|
|
|
{{ partial (printf $cp $fc) $root }}
|
2022-06-20 10:58:16 +08:00
|
|
|
</div>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ end }}
|
2022-06-05 16:14:17 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ end }}
|