Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add layout as body classname #10

Closed
h-enk opened this issue Dec 20, 2019 · 1 comment
Closed

Add layout as body classname #10

h-enk opened this issue Dec 20, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@h-enk
Copy link
Member

h-enk commented Dec 20, 2019

Replace line 4 of layouts/_default/baseof.html w/ <body{{ with .Params.layout }} class="{{ . }}"{{ end }}>

@h-enk h-enk added the enhancement New feature or request label Dec 20, 2019
@h-enk h-enk added this to the v1.0.2 milestone Dec 20, 2019
@h-enk h-enk self-assigned this Dec 20, 2019
@h-enk
Copy link
Member Author

h-enk commented Feb 6, 2020

  {{ if eq .Kind "home" -}}
    {{ .Scratch.Set "class" "home" }}
  {{ else if eq .Kind "404" -}}
    {{ .Scratch.Set "class" "error404" }}
  {{ else if eq .Kind "page" -}}
    {{ .Scratch.Set "class" .Type }}
    {{ .Scratch.Add "class" " single" }}
  {{ else -}}
    {{ .Scratch.Set "class" .Type }}
    {{ .Scratch.Add "class" " list" }}
  {{ end -}}
  <body class="{{ .Scratch.Get "class" }}">

@h-enk h-enk closed this as completed Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant