# Title specificity help

**URL:** <https://discourse.gohugo.io/t/title-specificity-help/35547>\
**Category:** support\
**Created:** [November 11, 2021, 9:44pm UTC](https://discourse.gohugo.io/t/title-specificity-help/35547 "2021-11-11T21:44:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oerlellijk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oerlellijk/32/15594_2.png) [@oerlellijk](https://discourse.gohugo.io/u/oerlellijk)\
**Post date:** [November 11, 2021, 9:44pm UTC](https://discourse.gohugo.io/t/title-specificity-help/35547/1 "2021-11-11T21:44:50Z")

</div>

Hi, everyone. I have a very specific problem that I need to fix. I have to stick the title of all pages be it article title or section title in the same place in the header. I can detect when the title is under all situations using this code

```auto
{{ if .IsHome }}
    <h1></h1>
{{ else if .IsSection }}
    <h1></h1>
{{ else}}
    <time>{{ .Date.Format "January 2, 2006" }}</time>	
    <h1></h1>
{{ end}}

```

This is my current structure

```auto
content/
    articles/
        _index.md
        art1.md
    stacks/ // .IsSection or .IsNode because of _index.md
        _index.md 
        art1.md // .IsPage
    _index.md //.IsHome
    about.md // here is the problem
    contact.md // here is the problem

```

and this is my page structure

```auto
partial head
partial header //title is in here
define main
    content
end
partial footer

```

The problem I have is that I don’t know what to do to remove the date from about.md and contact.md. They appear the same as every other page, and I know hugo doesn’t make a difference between pages, but still one is part of a section and the other two are free of every section. The idea is that I want to have dates added to pages that theoretically are posts.

Is there any way of doing that?

I know this sounds mad but I’m using the header as like the engine of the site. and everything is present there.

Thank you so much for the help, I’m at this for two weeks now.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [November 11, 2021, 10:15pm UTC](https://discourse.gohugo.io/t/title-specificity-help/35547/2 "2021-11-11T22:15:48Z")

</div>

```auto
{{ if and .IsPage (not (eq .Type "page")) }}
  {{ $datetime := .Date.Format "2006-01-02T15:04:05-07:00" }}
  {{ $date := .Date.Format "January 2, 2006" }}
  <time datetime="{{ $datetime }}">{{ $date }}</time>
{{ end }}
<h1>{{ .Title }}</h1>

```

Anything in the root of the content directory has `.Type` = `page`

```nohighlight
content/
├── articles/
│ ├── art1.md <-- .Type = articles
│ └── _index.md <-- .Type = articles
├── stacks/
│ ├── _index.md <-- .Type = stacks
│ └── stack1.md <-- .Type = stacks
├── about.md <-- .Type = page
├── contact.md <-- .Type = page
└── _index.md <-- .Type = page

```

---

<div class="post-metadata">

**Author:** ![oerlellijk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oerlellijk/32/15594_2.png) [@oerlellijk](https://discourse.gohugo.io/u/oerlellijk)\
**Post date:** [November 11, 2021, 10:41pm UTC](https://discourse.gohugo.io/t/title-specificity-help/35547/3 "2021-11-11T22:41:29Z")

</div>

Thank you! Thank you, so much!!

I used it like this:

```auto
        {{ if .IsHome }}
			<h1>
			<p></p>
			<p></p>
            </h1>
			<div class="navigation">
			</div>
		{{ else if .IsSection }}
			<h1 class="title">{{ .Title }}</h1>
		{{ else}}
			{{ if and .IsPage (not (eq .Type "page")) }}
				{{ $datetime := .Date.Format "2006-01-02T15:04:05-07:00" }}
				{{ $date := .Date.Format "January 2, 2006" }}
				<time datetime="{{ $datetime }}">{{ $date }}</time>
				<h1>{{ .Title }}</h1>
			{{ end }}
			{{ if and .IsPage (eq .Type "page") }}
				<h1 class="title">{{ .Title }}</h1>
			{{ end }}
		{{ end}}

```

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [November 13, 2021, 10:42pm UTC](https://discourse.gohugo.io/t/title-specificity-help/35547/4 "2021-11-13T22:42:21Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
