-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sean-pwd
committed
Sep 16, 2021
1 parent
b0dc0a7
commit 785380a
Showing
2 changed files
with
22 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- $template := "" -}} | ||
{{- if or (eq .Kind "404") (eq .Kind "page") (eq .Kind "home") -}} | ||
{{ $template = "single" -}} | ||
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}} | ||
{{ $template = "list" -}} | ||
{{- end -}} | ||
{{- $name := "" -}} | ||
{{- if eq .Kind "taxonomy" -}} | ||
{{- $name = printf "taxonomy %s" .Data.Plural -}} | ||
{{- else if eq .Kind "term" -}}- | ||
{{- $name = printf "term %s" .Section -}} | ||
{{- else if .Section -}} | ||
{{- $name = printf "section %s" .Section -}} | ||
{{- else if eq .Kind "page" -}} | ||
{{- $name = .File.ContentBaseName -}} | ||
{{- else if eq .Kind "home" -}} | ||
{{- $name = "home" -}} | ||
{{- else if eq .Kind "404" -}} | ||
{{- $name = "error404" -}} | ||
{{- end -}} | ||
{{- .Scratch.Set "class" (slice $template $name) -}} |