diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 35c4d71..3a56b50 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,29 +1,5 @@ -{{ range .Paginator.Pages.GroupByDate "2006" }} -
- {{ .Key }} -
-{{ range .Pages }} -
-
- -
- {{- if isset .Params "extlink" }} - - {{- .Title -}} - - - {{- else }} - - {{- end }} -
-
-
-{{ end }} -{{ end }} \ No newline at end of file +{{- if and .Page.IsSection (eq .Section "archives") }} + {{ partial "list.html" ((.Paginator (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)).Pages.GroupByDate "2006") }} +{{- else }} + {{ partial "list.html" (.Paginator.Pages.GroupByDate "2006") }} +{{- end }} diff --git a/layouts/_default/section.html b/layouts/_default/section.html index a9bce65..9e73648 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -8,6 +8,9 @@
{{- $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 }} diff --git a/layouts/partials/init.html b/layouts/partials/init.html index 4b51080..723603f 100644 --- a/layouts/partials/init.html +++ b/layouts/partials/init.html @@ -8,6 +8,9 @@ {{ $globalVars := newScratch }} {{ $globalVars.Set "postsCount" (len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)) }} +{{ range .Site.Params.mainSections }} + {{ $globalVars.Set . (len (where $.Page.Site.RegularPages "Section" .))}} +{{ end }} {{ $globalVars.Set "catsCount" (len .Site.Taxonomies.categories) }} {{ $globalVars.Set "tagsCount" (len .Site.Taxonomies.tags) }} diff --git a/layouts/partials/list.html b/layouts/partials/list.html new file mode 100644 index 0000000..7ddf390 --- /dev/null +++ b/layouts/partials/list.html @@ -0,0 +1,29 @@ +{{ range . }} +
+ {{ .Key }} +
+{{ range .Pages }} +
+
+ +
+ {{- if isset .Params "extlink" }} + + {{- .Title -}} + + + {{- else }} + + {{- end }} +
+
+
+{{ end }} +{{ end }} \ No newline at end of file