From 21f3a230963b0ac53b500758b54fd1869197ca6c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 19 Aug 2018 12:00:54 +0100 Subject: [PATCH] Simplify list page --- layouts/_default/list.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 38d7982..1d042a2 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -5,11 +5,9 @@ {{ if .Content }}
{{ end }} - {{ $parent := . }} - {{ $sorted_pages := sort .Site.Pages (default "Title" .Params.sort_by) (default "asc" .Params.sort_order)}} + {{ $sorted_pages := sort .Site.Pages "Title" "asc" }} {{ $valid_pages := where $sorted_pages ".Parent" "!=" nil }} - {{ $valid_pages := where $valid_pages ".Params.hide_in_list" "!=" "true" }} - {{ range where $valid_pages ".Parent.UniqueID" $parent.UniqueID }} + {{ range where $valid_pages ".Parent.UniqueID" .UniqueID }} {{ partial "list_item.html" . }} {{ end }}