浏览代码

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")
George Cushen 3 年之前
父节点
当前提交
079a61ab10
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      wowchemy/layouts/404.html

+ 1 - 1
wowchemy/layouts/404.html

@@ -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>