)
I'm trying to create my own theme for hugo.io. So far, everything works fine. My only problem is, that I can't get hugo to render the custom layouts for single section content.
For posts this works fine:
- The index.html gets called correctly
- The single.html inside the "layouts/posts" gets called correctly
- For tutorials, the list layout works correctly
- The permalinks for all files and lists work correctly
The problem: * For tutorials, the single layout doesn't call the "layouts/tutorials/single.html" layout. Instead it uses "layouts/_default/single.html"
I tried the following:
- add type= "tutorial" preface setting to all tutorial .md files
- add layout= "tutorial" preface setting to all tutorial .md files
- add a "tutorial.html" file inside the "layouts/_default" folder (also tried naming it "tutorials.html)
- add a "tutorial.html" file inside the "layouts" folder (same as above)
sadly, none of this works
My setup of content:
content
|__ posts
|__ new_post.md
|__ tutorials
|__ new-tutorial.md
My setup of layouts (inside my theme folder):
layouts
|__ _default
|__ list.html
|__ single.html
|__ posts
|__ list.html
|__ single.html
|__ tutorials
|__ list.html
|__ single.html
|__index.html
My single tutorial content (new-tutorial.md):
+++
title = "My new Tutorial"
date: 2019-10-04T14:10:46+02:00
draft: false
type: tutorial
layout: tutorial
+++
# Custom Content Headline
There is no error message from hugo. I expect hugo to open the page "http://localhost:1313/tutorials/new-tutorial/ with the layout that lies in the file "layouts/tutorials/single.html"