HUGO

Sort By File Path For Paginator Page?

I have 4 post files ->

01-my-school.md
02-my-works.md
03-my-books.md
04-my-hobby.md

On config.yaml, I set /:title/ for permalinks. And only title that contained on front matter of each post files. Without any date, weight, etc, on front matter.

I tried this but I got an error ->

{{ range .Paginate(.Pages).ByFilePath }}

How to sort my posts by file path for my paginator / blog page?

I tried this too ->

{{ range .Paginate(.Pages).ByFileName }}

But still got an error?

Sorry—this is a very late reply.

You can use this for example (or use other file variables):

{{ range sort .Pages "File.TranslationBaseName" }}
  {{ . }}
{{ end }}