How to check If not homepage

I know there is .IsHome but is there an opposite function?

I would like to do something like this:

{{if not .IsHome}}
do something
{{end}}

I’ve tried doing the following but it doesn’t work.

{{if ne .URL .Site.BaseURL}}
do something
{{end}}

I may sound silly, but doesn’t .IsHome return true or false? Hence, it can be used to determine if a page is not a home page?

Try exactly that!

5 Likes