# Trying to define a page

**URL:** <https://discourse.gohugo.io/t/trying-to-define-a-page/9547>\
**Category:** support\
**Created:** [December 9, 2017, 4:29am UTC](https://discourse.gohugo.io/t/trying-to-define-a-page/9547 "2017-12-09T04:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![quanghieuci](https://avatars.discourse-cdn.com/v4/letter/q/9dc877/32.png) [@quanghieuci](https://discourse.gohugo.io/u/quanghieuci)\
**Post date:** [December 9, 2017, 4:29am UTC](https://discourse.gohugo.io/t/trying-to-define-a-page/9547/1 "2017-12-09T04:29:54Z")

</div>

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/\_index.md 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/\_index.md:  
{  
“title”: “Home”  
}  
thx all

---

<div class="post-metadata">

**Author:** ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)\
**Post date:** [December 9, 2017, 12:04pm UTC](https://discourse.gohugo.io/t/trying-to-define-a-page/9547/2 "2017-12-09T12:04:13Z")

</div>

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.

```auto
<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.
