This post explains how to change the sort order of the post list in the PaperMod theme for Hugo to descending order by last modified date. For blogs like this one that frequently update existing posts, the last modified date is a better representation of the latest state than the original publication date.
Environment
- Windows 11 / Git Bash
- Hugo v0.164.0 / Standard build compatible
- PaperMod v8.0 / Latest commit as of writing
$ hugo version
hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended windows/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio
$ cd themes/PaperMod && git log -1 --oneline
154d006 (HEAD -> master, origin/master, origin/HEAD) style(post-single): adjust padding for details summary element
Setup Steps
1. Add a custom layout
Copy themes/PaperMod/layouts/list.html to create layouts/list.html.
2. Add the sort by last modified date
Add the highlighted line below to the custom layout to sort posts by last modified date in descending order.
{{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }}
{{- end }}
{{- $pages = $pages.ByLastmod.Reverse }}
{{- $paginator := .Paginate $pages }}
3. Check the result
Run hugo server to start the development server and check the result.
If the post list is sorted by last modified date, you’re good.
If you want the last modified date to be visible in the post list, refer to the How to Display the Last Modified Date for Posts in Hugo PaperMod post to add the display.