Sort a range by custom param

You could try breaking it up to debug it

{{ $pages := where $.Site.RegularPages "Type" ($page.Params.folder | default "project") }}
{{ range $idx, $item := first 6 (sort $pages ".Params.date_sort" "desc") }}