Update date for a blog post

I have wrote a blog article on 23 of January, this is also written in the "date: " front matter.
Now I have updated the blog post.

When I change the "date: " in the front matter is the original post date gone, isn’t it?

The only solution what I see is to add some kind of ‘Histroy table’ some ware on the blog site.
Any other ideas or solutions?

You might find what you’re looking for in the docs. There are several date-based variables for you to choose from: https://gohugo.io/variables/page/#page-variables


I have added

lastmod: 2017-08-20

into the font matter

I have tried the following but none of them works.

Last modified: {{ .Page.Date.Lastmod }}
Last modified: {{ .Date.Lastmod }}
Last modified: {{ .Lastmod }}

I use netlify.

That last one should work for sure. I can’t say much without seeing your templates.

Ah okay maybe that’s the problem. I use this in a content file.

Is this possible there?

You can’t have spaces in front matter keys:

lastmod: 2017-08-30


It’s now solved with a shortcode.


{{ dateFormat ( or $.Site.Params.dateFormat "2006, Jan 02" ) $.Page.Params.LastMod }}

Glad it worked out. I’m still a little confused on your use case, but in the event that I might be on the same page w/r/t to what you’re trying to accomplish, you might want to check out the following: