{{ $page := . }}
{{ $max := "" }}

{{ range $page.RegularPages }}
    {{ if or (not $max) (lt $max .Lastmod) }}
        {{ $max = .Lastmod }}
    {{ end }}
{{ end }}

{{ if not $max }}
    {{ $max = $page.Lastmod }}
{{ end }}

{{ return $max }}
