refactor(list.html): correct indention

This commit is contained in:
ZhenShuo Leo
2025-07-16 14:02:04 +08:00
parent 2c71bda97f
commit 9bf09a8a3f
+9 -16
View File
@@ -1,5 +1,4 @@
{{ define "main" }} {{ define "main" }}
{{ .Scratch.Set "scope" "list" }} {{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.list.showHero | default false }} {{ if .Site.Params.list.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.list.heroStyle ".html" }} {{ $heroStyle := print "hero/" .Site.Params.list.heroStyle ".html" }}
@@ -10,8 +9,8 @@
{{ end }} {{ end }}
{{- end -}} {{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in {{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in .TableOfContents "<ul") }}
.TableOfContents "<ul") }} <header> <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }} {{ partial "breadcrumbs.html" . }}
{{ end }} {{ end }}
@@ -47,13 +46,9 @@
<div class="min-w-0 min-h-0 max-w-prose"> <div class="min-w-0 min-h-0 max-w-prose">
{{ .Content }} {{ .Content }}
</div> </div>
</section> </section>
{{ if gt .Pages 0 }}
{{ if gt .Pages 0 }}
{{ $cardView := .Params.cardView | default (.Site.Params.list.cardView | default false) }} {{ $cardView := .Params.cardView | default (.Site.Params.list.cardView | default false) }}
{{ $cardViewScreenWidth := .Params.cardViewScreenWidth | default (.Site.Params.list.cardViewScreenWidth | default false) }} {{ $cardViewScreenWidth := .Params.cardViewScreenWidth | default (.Site.Params.list.cardViewScreenWidth | default false) }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.list.groupByYear | default false) }} {{ $groupByYear := .Params.groupByYear | default ($.Site.Params.list.groupByYear | default false) }}
@@ -61,7 +56,6 @@
{{ $groupByYear := and (not $orderByWeight) $groupByYear }} {{ $groupByYear := and (not $orderByWeight) $groupByYear }}
{{ if not $cardView }} {{ if not $cardView }}
<section class="space-y-10 w-full"> <section class="space-y-10 w-full">
{{ if not $orderByWeight }} {{ if not $orderByWeight }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
@@ -84,7 +78,6 @@
{{ else }} {{ else }}
{{ if $groupByYear }} {{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $cardViewScreenWidth }} {{ if $cardViewScreenWidth }}
<div class="relative w-screen max-w-[1600px] px-[30px] left-[calc(max(-50vw,-800px)+50%)]"> <div class="relative w-screen max-w-[1600px] px-[30px] left-[calc(max(-50vw,-800px)+50%)]">
@@ -97,7 +90,9 @@
{{ partial "article-link/card.html" . }} {{ partial "article-link/card.html" . }}
{{ end }} {{ end }}
</section> </section>
{{ if $cardViewScreenWidth }} </div> {{ end }} {{ if $cardViewScreenWidth }}
</div>
{{ end }}
{{ end }} {{ end }}
{{ else }} {{ else }}
@@ -120,12 +115,12 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</section> </section>
{{ if $cardViewScreenWidth }} </div> {{ end }} {{ if $cardViewScreenWidth }}
</div>
{{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ else }} {{ else }}
<section class="mt-10 prose dark:prose-invert"> <section class="mt-10 prose dark:prose-invert">
<p class="py-8 border-t"> <p class="py-8 border-t">
@@ -133,7 +128,5 @@
</p> </p>
</section> </section>
{{ end }} {{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{ end }} {{ end }}