Unable to override single.html

I have a content/about/index.html that is being rendered IIUC via layouts/_default/single.html essentially.

However if try override this file by placing a layouts/about/single.html it doesn’t work.

I’ve stared at the documentation upon https://gohugo.io/templates/lookup-order/ and I simply don’t understand what needs to be done. Thanks!

I see you are writing index.html instead of index.md in the about folder. Might be a typo or a probable reason for your issue. I too would expect layouts/about/single.html to overwrite layouts/_default/single.html. The problem is, you might have another template that is rendered and not overwritten in place of the _default one. If you post a link to a public repo we can have a look into this.

If you prefer to not dive into the issue you could have a look at the layout parameter for your frontmatter:

Sorry, it was a typo. content/about/index.html should have read content/about/index.md. Oops.

Didn’ t know about layout which is explicit, which is good. Thank you.

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