# Layout doesn't apply

**URL:** <https://discourse.gohugo.io/t/layout-doesnt-apply/23752>\
**Category:** support\
**Created:** [February 29, 2020, 6:09pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752 "2020-02-29T18:09:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![McStar](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@McStar](https://discourse.gohugo.io/u/McStar)\
**Post date:** [February 29, 2020, 6:09pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752/1 "2020-02-29T18:09:45Z")

</div>

Hi all!

I saw many treads on this site about layout. But I have trouble.  
I have the following structure:

```auto
content/calendar/index.md

```

with the following content:

```markdown
---
title: "Календарь"
date: 2020-02-29
draft: false
# type: calendar
# layout: calend
---

123

```

Also I have the folowing layouts:

```auto
layouts/calendar/single.html

```

It contains:

```auto
{{ define "main" }}
<section id="main">
    {{ .Title }} {{.Content}} {{ .Date }}
    <div>
        <article id="content">
            {{ .Content }}
        </article>
    </div>
</section>
{{ end }}

```

But when I open `/calendar/` link I just see only `123` content.

I’ve tried [potato-dark](https://themes.gohugo.io/potato-dark/) and [noteworthy](https://themes.gohugo.io/hugo-theme-noteworthy/) themes. Result the same.

---

<div class="post-metadata">

**Author:** ![aris](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/aris/32/3411_2.png) [@aris](https://discourse.gohugo.io/u/aris)\
**Post date:** [February 29, 2020, 11:01pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752/2 "2020-02-29T23:01:20Z")

</div>

Try this on your Front Matter:

```auto
---
title: "Календарь"
date: 2020-02-29
draft: false
layout: "calendar"
---

```

And put `calendar.html` in `_default/`

---

<div class="post-metadata">

**Author:** ![McStar](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@McStar](https://discourse.gohugo.io/u/McStar)\
**Post date:** [March 1, 2020, 7:02pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752/3 "2020-03-01T19:02:12Z")

</div>

After this I’ve got 404.

---

<div class="post-metadata">

**Author:** ![McStar](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@McStar](https://discourse.gohugo.io/u/McStar)\
**Post date:** [March 1, 2020, 8:00pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752/4 "2020-03-01T20:00:31Z")

</div>

Noted one thing, if `single.html` contains only

```auto

<section id="main">
    {{ .Title }} {{.Content}} {{ .Date }}
    <div>
        <article id="content">
            {{ .Content }}
        </article>
    </div>
</section>

```

without `define` it rendered, but without style.

---

<div class="post-metadata">

**Author:** ![McStar](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@McStar](https://discourse.gohugo.io/u/McStar)\
**Post date:** [March 1, 2020, 8:32pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752/5 "2020-03-01T20:32:26Z")

</div>

I’ve got it! Themes doesn’t contain “main” template and hugo did not find them. Question is closed. Thanks!

---

<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:** [March 3, 2020, 8:41pm UTC](https://discourse.gohugo.io/t/layout-doesnt-apply/23752/6 "2020-03-03T20:41:43Z")

</div>

Closed on March 3, 2020, 8:41pm UTC

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