Does something changed in regards to Lastmod field.
I got some posts that have DATE, and otheres that have DATE and LASTMOD fields.
This used to return this correctly
{{ if eq .Date .Lastmod }}
True
{{ else }}
False
{{ end }}
But right now, if post got DATE only, it returning False, and when have DATE and LASTMOD (both different) returning False as well.
Noticed, that here Configure Hugo | Hugo
the default frontmatter for lastmod include :git
first, so I removed it in my configuration as follow:
[frontmatter]
date = ['date', 'publishdate', 'pubdate', 'published', 'lastmod', 'modified']
expiryDate = ['expirydate', 'unpublishdate']
lastmod = ['lastmod', 'modified', 'date', 'publishdate', 'pubdate', 'published']
publishDate = ['publishdate', 'pubdate', 'published', 'date']
even that {{ .Date }}
and {{ .Lastmod }}
reporting same figure, for eq
is still False.
Bug?
This is working:
{{ $date := .Date.Format "2006-01-02T15:04:05.000" }}
{{ $lastmod := .Lastmod.Format "2006-01-02T15:04:05.000" }}
{{ if eq $date $lastmod }}
True
{{ else }}
False
{{ end }}
Simillar issue reported when using (from gohugoioTheme/layouts/partials/opengraph/opengraph.html at b1860f34918076c90101316a052165501ee61dad · gohugoio/gohugoioTheme · GitHub)
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
the .Lastmod
always reporting it as “having” LASTMOD even when not specified