-
- {{ $categories := .Site.Taxonomies.categories }}
+ {{ $allPages := where .Site.RegularPages "Type" "post" }}
+
+
+ {{ $parentCategories := slice }}
+ {{ range $allPages }}
+ {{ if gt (len .Params.categories) 0 }}
+ {{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
+ {{ end }}
+ {{ end }}
+ {{ $parentCategories = $parentCategories | uniq | sort }}
+
+
+ {{ range $index, $category := $parentCategories }}
+ {{ $parentName := . }}
+ {{ $subcategories := slice }}
+ {{ $parentPages := slice }}
-
- {{ $parentCategories := slice }}
- {{ range $name, $taxonomy := $categories }}
- {{ range $taxonomy.Pages }}
- {{ if gt (len .Params.categories) 0 }}
- {{ $parentCategories = $parentCategories | append (index .Params.categories 0) }}
+
+ {{ range $allPages }}
+ {{ if gt (len .Params.categories) 0 }}
+ {{ if eq (index .Params.categories 0) $parentName }}
+ {{ $parentPages = $parentPages | append . }}
+ {{ if gt (len .Params.categories) 1 }}
+ {{ $subcategories = $subcategories | append (index .Params.categories 1) }}
+ {{ end }}
{{ end }}
{{ end }}
{{ end }}
- {{ $parentCategories = $parentCategories | uniq | sort }}
-
-
- {{ range $parentCategories }}
- {{ $parentName := . }}
- {{ $subcategories := slice }}
- {{ $parentPages := slice }}
-
-
- {{ range $name, $taxonomy := $categories }}
- {{ range $taxonomy.Pages }}
- {{ if gt (len .Params.categories) 0 }}
- {{ if eq (index .Params.categories 0) $parentName }}
- {{ $parentPages = $parentPages | append . }}
- {{ if gt (len .Params.categories) 1 }}
- {{ $subcategories = $subcategories | append (index .Params.categories 1) }}
+ {{ $subcategories = $subcategories | uniq | sort }}
+
+
+
+
+ {{ if gt (len $subcategories) 0 }}
+
+
+ {{ range $subcategories }}
+ {{ $subCategoryName := . }}
+
+
+ {{ $subPages := slice }}
+ {{ range $parentPages }}
+ {{ if gt (len .Params.categories) 1 }}
+ {{ if eq (index .Params.categories 1) $subCategoryName }}
+ {{ $subPages = $subPages | append . }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+
+ -
+
+ {{ $subCategoryName }}
+
+ {{ len $subPages }}
+ {{ if gt (len $subPages) 1 }}
+ {{ i18n "categories.post_measure" | default (i18n "categories.post_measure.plural") }}
+ {{ else }}
+ {{ i18n "categories.post_measure" | default (i18n "categories.post_measure.singular") }}
+ {{ end }}
+
+
+ {{ end }}
+
+
+ {{ end }}
+
+ {{ end }}
{{ end }}
\ No newline at end of file