Last Modified Date with Hugo

I want to have a last modification date on some of my sites. I found this link https://www.andrewjstevens.com/posts/2021/03/last-modified-date-with-hugo/ for last modified and I tried to implement this in my handbook.md page. What I do wrong? Please take a look on the screen shot.

I have in the hugo.toml


enableGitInfo = true

[frontmatter]
  date = ["date", "publishDate", "lastmod"]
  lastmod = ["lastmod", ":git", "date", "publishDate"]

In the handbook.md


---
title: "Handbook"
description: "Handbook"
draft: false
slug: handbook
---

# <u>Handbook</u>

Last Modified: {{ .Lastmod.Format "2 January 2006" }}

## General

IMG

Place content in content files.
Place template code in template files.

I wrote this into the single.html It worked.

{{ define "main" }}
<div class="container">
	<div class="row">
		<div class="col p-4">
			{{ .Content }}
			{{ $published := .PublishDate | time.Format ":date_medium" }}
			{{ $modified := .Lastmod | time.Format ":date_medium" }}

			{{ if ne $published $modified }}
			<span> Last modified: {{ $modified }} </span>
			{{ end }}
		</div>
	</div>
</div>
{{ end }}