In the docs it states the look up order for single page templates (not using a theme so I skipped those):
- /layouts/<TYPE>/<LAYOUT>.html - /layouts/<SECTION>/<LAYOUT>.html - /layouts/<TYPE>/single.html - /layouts/<SECTION>/single.html - /layouts/_default/single.html
I have a section/folder called videos inside of Content, in one of the files there I have this for the front matter:
--- layout: youtube title: Using the Canvas Wrap Layout Actions description: Quick and easy demo of the Canvas Wrap Layout Actions sortnum: 1 postedon: July 11th, 2011 youtubeurl: Jifvy-BZ4qI type: photoshop ---
In my layouts folder I have a folder called videos (which is the section/folder name where the file is located) and inside that I have a file called youtube.html.
but it doesn;t work, it is pulling in the main template rather than the youtube layout I specified.
Shouldn’t it work as it is the same as the second one in the docs?
If I run with verbose on I get:
Unable to locate layout for "page": [photoshop/youtube1.html.html photoshop/youtube1.html _default/youtube1.html.html _default/youtube1.html theme/photoshop/youtube1.html.html theme/photoshop/youtube1.html theme/_default/youtube1.html.html theme/_default/youtube1.html]
it isn’t even looking at the section - videos.
Hugo vs 27.1
I am still learning hugo so I assume I am doing something wrong, but it looks correct to me.
If I remove Type from the front matter it works as I expect. Maybe I am using Type incorrectly, I can just change that to something else and then it will do what I want I think.