Hugo

.IsHome is false on my homepage

Problem:

I used {{ if .IsHome}}something{{ end }} on my footer partial to display something only in the footer on the homepage.

My homepage does not display something, the other pages too do not display.

I had no homepage template and I thought somehow Hugo sees it as a section instead of the homepage so I created an index.html inside of layouts. Still it does not what I expect.

I am sure I am overlooking something.

Share your code. Or give us a minimal example, so we can attempt to reproduce this.

Have a look at https://github.com/davidsneighbour/samui-samui.de/

The {{ if .IsHome }} is found in layouts/footer/tagcloud.html

it’s a {{ partialCached }} issue… let me look into it…

1 Like

Yes. It was a typical unconcentrated oversight, sorry… I loaded the template via partialCached and of course, it loaded the same content everywhere. Once changed to just partial it worked as expected and .IsHome worked as expected. Sorry for the commotion, I’ll go into embarrassed hiding for a while now.