Kind is not a field

Sorry if this is a noob questions, but I am a noob when it comes to Hugo. From the docs, it sounds like I should be able to use the .Kind variable on pretty much any page, home, section, taxonomy or taxonomyTerm. I must be misunderstanding something though because I keep getting errors along the lines of “Kind is not a field of struct type *hugolib.Node” or “Kind is not a field of struct type *hugolib.Page”. As a minimal example, after running hugo new site and creating layouts/index.html which just contains {{ .Kind }}, I expect that the homepage would have just “home”. Similarly, if I use .Kind in layouts/_defaults/single.html to render a regular page, I just get the error that Kind isn’t a field of Page. I’d like to be able to tweak the behavior of certain partial templates based on .Kind, but I can’t figure out how to use it. Any pointers would be much appreciated.

You must use Hugo version >= 0.18 for Kind to be available.

1 Like