Trying to define a page

I have a same problem with this topic , but there have no reply so i copied this topic

"I am trying to define a page .Title for my index.html, by ways of front matter in the content/ file. However, when I display the title via:
<title>{{ block "title" . }}{{ .Site.Title }} {{ with .Title }} | {{ . }}{{ end }}{{ end }}</title>

I end up with a result of SiteTitle | SiteTitle rather than Title | SiteTitle.

Here is my content/
“title”: “Home”
thx all

I have this in my template which is similar to your solution but just the other way round. So it works for me and then it should work for you. If not please post your github repo to have a closer look.

<title>{{ block "title" . }}{{ if not .IsHome }}{{ .Title }} | {{ .Site.Title }}{{ else }}{{ .Site.Title }}{{ end }}{{ end }}</title>

Edit: Forgot to say that this codeblock is in the baseof.html. Therefore it has block in it.