Documentation clearly states that Hugo will look inside layouts/_default folder for template type:
I have a file: layouts/_default/book.html and the layout is successfully used by all my files in /content/books/ where my frontmatter has layout: book in it.
But for my file /content/test.mdHugo does not apply the book.html layout even though layout: book is set in frontmatter.
I could copy over the book.html file into my layouts/_default/page for it to work, but I donβt want two copies of the same file - thatβs bad coding.
I resorted to explicitly stating type: _default (which fixes the issue) but that feels absurd.
Could someone explain whether this is a bug with code, documentation, or my understanding of Hugo
A pageβs .Type is inferred from its top level directory. So, with the proper directory structure, it is seldom necessary to add either type or layout to a pageβs front matter. This makes our content easier to create, edit, and organize/reorganize.