.Site.LastChange stopped working?

I have tried the following in a partial called site_copyright.html:

<div class="site-copyright" role="contentinfo">&copy; {{ .Site.LastChange.Format "2006" }} {{ if .Site.Params.CopyrightLine }}{{.Site.Copyright}}{{ end }}</div>

And then…

<div class="site-copyright" role="contentinfo">&copy; {{ dateFormat .Site.LastChange "2006" }} {{ if .Site.Params.CopyrightLine }}{{.Site.Copyright}}{{ end }}</div>

And both result in the same HTML written to the page

The two snippets looks functional the same to me. What did you expect?

Well, maybe output is the Problem, date of last change 0001 seems a bit curious für visitor?

@bep Indeed. Did you see the image I attached? Until yesterday, it was writing “2016.” I wasn’t hoping for “0001.” Since I haven’t changed the templating language for this at all, I was wondering if I missed something.

For the site lastchange it takes the date or lastmod from the last Page (being the first page in the default sort) … it doesn’t check if that page actually have a date. What you see is probably a Zero date (i.e. date not set). Check the front matter of your latest addition.

That did it. I added an extra dummy page - contents/json/dummy.md to make a site-index.html that I write to site-index.json as part of a bash script and completely forgot to add a date in the yaml. Thanks much, @bep.

A post was split to a new topic: Format .Site.LastChange