Layout doesn't apply

Hi all!

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

content/calendar/index.md

with the following content:

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

123

Also I have the folowing layouts:

layouts/calendar/single.html

It contains:

{{ 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 and noteworthy themes. Result the same.

Try this on your Front Matter:

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

And put calendar.html in _default/

After this I’ve got 404.

Noted one thing, if single.html contains only


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

without define it rendered, but without style.

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

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