Can't get sort by modif dates working

Hi,
I have

{{ define "menu-filetree" }}
{{$currentpage := index . 1 }}
{{range (index . 0).Pages.ByLastMod }}
<a href="{{ .Page.RelPermalink }}">{{- .Page.LinkTitle|.RenderString -}}</a>
{{ end }}
{{ end }}

{{range (index . 0).Pages.ByLastMod }}` in a partial,

[frontmatter]
  lastmod = [':fileModTime']

in the config, but I still get:

template: partials/docs/menu.html:30:18: executing “menu-filetree” at <0>: can’t evaluate field ByLastMod in type page.Pages

Why ? It works fine without the method suffixed.

Version: hugo v0.125.6-69ede10edcd539380914bbee58d4d32953dd8b43+extended linux/amd64 BuildDate=2024-05-05T10:52:52Z VendorInfo=gohugoio

https://gohugo.io/methods/pages/bylastmod/

1 Like

Case sensibility. :face_with_symbols_over_mouth: :face_with_symbols_over_mouth:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.