Here’s a portion of layouts/_default/baseof.html:
{{- $bodyClasses := slice -}}
{{- $bodyClasses = $bodyClasses | append (printf "page-kind-%s" .Kind) -}}
{{- $bodyClasses = $bodyClasses | append (printf "content-type-%s" .Type) -}}
{{- $bodyClasses = $bodyClasses | append (cond .IsDraft "draft" "not-draft") -}}
<body class="{{ delimit $bodyClasses ` ` }}"></body>
When the home page is rendered:
<body class="page-kind-home content-type-page not-draft">
Note that the content type is page
. Conceptually the home page doesn’t have a content type; it’s the home page. Why is this a problem?
I typically create a “page” content type for static pages (about, contact, etc.). Any style I apply using the .content-type-page
class selector will apply to the home page as well as about, contact, etc. This is unexpected and not desirable.
Seems to me that the home page .Type should be home
. Thoughts?