hugo-theme-relearn/layouts/partials/output-partial.html

10 lines
520 B
HTML
Raw Normal View History

{{- $base := .base }}
{{- $page := .page }}
{{- $parameter := .parameter }}
{{- if or (not ($page.Scratch.Get "relearnOutputFormat")) (not (fileExists (printf "/layouts/partials/%s.%s.html" $base (($page.Scratch.Get "relearnOutputFormat") | lower)))) }}
{{- if (fileExists (printf "/layouts/partials/%s.html" $base)) }}
{{- partial (printf "%s.html" $base) $parameter }}
{{- end }}
{{- else }}
{{- partial (printf "%s.%s.html" $base ((.page.Scratch.Get "relearnOutputFormat") | lower)) $parameter }}
{{- end }}