To add two pages in a condition class

I need your help for a quite simple question.
I have the following code for the baseof layout;

<body id="page"{{ if ne .IsHome true }} class="sidebar"{{ end }}>
	{{ block "header" . -}}{{ end -}}
	{{ block "main" . -}}{{ end -}}
	{{ block "footer" . -}}{{ end }}
</body>

In addition of the .IsHome exclusion I would like to add the same exclusion for the 404.html page.
How to do that ?
Thank you

You can use .Kind to differentiate each page. See Page Variables

But here im using in to check whether the .Kind value match exclude list.

{{- $exclude := slice "home" "404" -}}
<body id="page"{{ if not (in $exclude .Kind) }} class="sidebar"{{ end }}>
	{{ block "header" . -}}{{ end -}}
	{{ block "main" . -}}{{ end -}}
	{{ block "footer" . -}}{{ end }}
</body>

Thanks.
It works well !

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