{{/* Copied and adapted from Ananke theme's implementation, initially in order to enforce date-ordering on Related Pages: https://blog.scubbo.org/posts/tags-in-archetype/ */}} {{/* Use Hugo's native Table of contents feature. You must set `toc: true` in your parameters for this to show. https://gohugo.io/content-management/toc/ */}} {{- if .Params.toc -}} {{- end -}} {{/* Use Hugo's native related content feature to pull in content that may have similar parameters, like tags. etc. https://gohugo.io/content-management/related/ */}} {{ $related := .Site.RegularPages.Related . | first 15 }} {{/* So far as I can tell, it's not possible to pipe _into_ sort - it needs to return */}} {{ $related_sorted := sort $related "Date" "desc"}} {{ with $related_sorted }} {{ end }}