🐛 Fix: collection nav and list can not show in posts that have password

This commit is contained in:
Cell
2024-07-11 09:45:32 +08:00
parent 6d9c6f5b93
commit 2b2bde7ba8
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1,14 +1,14 @@
{{- /* Collection List */ -}}
{{- $params := partial "function/params.html" -}}
{{- if .Params.collections | and $params.collectionList | and (not $params.password) -}}
{{- if .Params.collections | and $params.collectionList -}}
{{- $collectionTerms := .GetTerms "collections" -}}
{{- range $collectionTerms -}}
{{- $pages := (where .Pages "Params.Weight" "!=" nil) | append (where .Pages "Params.Weight" "eq" nil).ByDate -}}
{{- $open := eq (index $collectionTerms 0) . -}}
{{- $currentKey := 0 -}}
<div class="details collection-details{{ if $open }} open{{ end }}">
<div class="details collection-details{{ with $params.password }} encrypted-hidden{{ end }}{{ if $open }} open{{ end }}">
<div class="details-summary collection-summary">
{{ dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html" }}
<span class="collection-name" data-collections="{{ T "collections" }}">{{ .LinkTitle }}</span>
+2 -2
View File
@@ -1,7 +1,7 @@
{{- /* Collection Navigation */ -}}
{{- $params := partial "function/params.html" -}}
{{- if .Params.collections | and $params.collectionNavigation | and (not $params.password) -}}
{{- if .Params.collections | and $params.collectionNavigation -}}
{{- $collectionTerms := .GetTerms "collections" -}}
{{- range $collectionTerms -}}
{{- $termLink := printf `<a href="%v">%v <span>%v・%v</span></span></a>`
@@ -10,7 +10,7 @@
(T "collection")
.LinkTitle
-}}
<div class="collection-card">
<div class="collection-card{{ with $params.password }} encrypted-hidden{{ end }}">
<div class="collection-title text-secondary">
{{- dict "Collections" $termLink | T "single.includedIn.collections" | strings.FirstUpper | safeHTML }} {{ .Pages.Len -}}
</div>