fix: 404 "latest" order when some pages contain weights

Prevent Hugo ordering weighted pages higher in the "latest" content list.

Also include course/docs index pages (Hugo "sections") and remove private pages (although Hugo render option is preferred equiv to "private:true")
This commit is contained in:
George Cushen 2021-05-26 23:09:50 +01:00
commit 079a61ab10

View file

@ -15,7 +15,7 @@
<p>{{ i18n "404_recommendations" }}</p>
{{ $query := site.RegularPages }}
{{ $query := where (where (where site.Pages.ByDate.Reverse "Title" "!=" "") "Kind" "in" (slice "home" "page" "section")) "Params.private" "!=" true }}
{{ $count := len $query }}
{{ if gt $count 0 }}
<h2>{{ i18n "user_profile_latest" }}</h2>