Add include file kind variants

This commit is contained in:
Will Faught
2025-02-07 23:21:13 -08:00
parent 49d876e533
commit 598671aab3
8 changed files with 57 additions and 47 deletions

View File

@@ -0,0 +1,25 @@
{{ $params := . }}
{{ $name := $params.name }}
{{ $page := $params.page }}
{{ $partial := print "paige/" (printf $name "") }}
{{ $file := print "partials/" $partial }}
{{ if templates.Exists $file }}
{{ partial $partial $page }}
{{ end }}
{{ range slice "home" "page" "section" "taxonomy" "term" }}
{{ $partial := print "paige/" (printf $name (print "-" .)) }}
{{ $file := print "partials/" $partial }}
{{ $exists := templates.Exists $file }}
{{ $matches := eq $page.Kind . }}
{{ if and $exists $matches }}
{{ partial $partial $page }}
{{ end }}
{{ end }}