hugo-theme-next/layouts/_default/section.html

37 lines
1.2 KiB
HTML
Raw Normal View History

2022-06-07 18:16:40 +08:00
{{- define "title" }}
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "AllSome" }} - {{ .Site.Title -}}
{{- end -}}
{{ define "main_inner_class" }}archive posts-collapse{{ end }}
{{- define "main" }}
<div class="post-block">
<div class="post-content">
<div class="collection-title">
{{- $cheers := "Um" }}
{{- $posts := .Scratch.Get "posts" }}
{{- if gt $posts 210 }}
{{- $cheers = "Excellent" }}
{{- else if gt $posts 130 }}
{{- $cheers = "Great" }}
{{- else if gt $posts 80 }}
{{- $cheers = "Good" }}
{{- else if gt $posts 50 }}
{{- $cheers = "Nice" }}
{{- else if gt $posts 30 }}
{{- $cheers = "Ok" }}
{{- end }}
<span class="collection-header">
{{- T (printf "PostArchiveCheers%s" $cheers) }}
{{- T "SymbolComma"}}
{{- T "ArchiveCounterTitle" $posts }}
{{- T "SymbolComma"}}
{{- T "PostArchiveKeepOn" }}
</span>
</div>
{{ range (.Paginate (.Data.Pages.GroupByDate "2006") 5 ).PageGroups }}
{{- partial "post/list.html" . }}
{{ end }}
</div>
</div>
{{- partial "pagination.html" . }}
{{- end }}