🔧 Re Change default section display not use archive page.
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
{{- if and .Page.IsSection (eq .Section "archives") }}
|
||||
{{- $paginator := (.Paginate (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)).Pages.GroupByDate "2006" }}
|
||||
{{ partial "list.html" $paginator }}
|
||||
{{ else }}
|
||||
{{- $paginator := .Paginator.Pages.GroupByDate "2006" }}
|
||||
{{ partial "list.html" $paginator }}
|
||||
{{- end }}
|
||||
{{ $paginator := .Paginator.Pages.GroupByDate "2006" }}
|
||||
{{ partial "list.html" $paginator }}
|
||||
|
||||
|
||||
@@ -1,39 +1,15 @@
|
||||
{{- 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 "postsCount" }}
|
||||
{{- if and .Page.IsSection (ne .Section "archives") }}
|
||||
{{- $posts = .Scratch.Get .Section }}
|
||||
{{- end }}
|
||||
{{- 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 | safeHTML }}
|
||||
{{- T "SymbolComma" }}
|
||||
{{- T "PostArchiveKeepOn" }}
|
||||
</span>
|
||||
</div>
|
||||
{{ define "main_inner_class" }}index posts-expand{{ end }}
|
||||
|
||||
{{ .Render "list" }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{- partial "pagination.html" . }}
|
||||
{{- define "main" }}
|
||||
|
||||
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "==" .Section) }}
|
||||
{{- range $paginator.Pages }}
|
||||
{{ partial "post.html" (dict "ctx" . "IsHome" true) }}
|
||||
{{- end }}
|
||||
|
||||
{{- partial "partials/pagination.html" . }}
|
||||
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user