theme: cache output-suffix #380

This commit is contained in:
Sören Weber 2022-11-12 23:39:48 +01:00
parent a425a0680c
commit dbb37a29a8
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -1,14 +1,14 @@
{{- $base := .base }} {{- $base := .base }}
{{- $page := .page }} {{- $page := .page }}
{{- $parameter := .parameter }} {{- $parameter := .parameter }}
{{- $format := partial "output-format.hugo" $page }} {{- $outputFormat := partial "output-format.hugo" $page }}
{{- $suffix := partial "output-suffix.hugo" $page }} {{- $suffix := partialCached "output-suffix.hugo" $page $page $outputFormat }}
{{- $f := printf "/layouts/partials/%s.%s.%s" $base $format $suffix }} {{- $f := printf "/layouts/partials/%s.%s.%s" $base $outputFormat $suffix }}
{{- if or (not $format) (not (partialCached "fileExists.hugo" $f $f)) }} {{- if or (not $outputFormat) (not (partialCached "fileExists.hugo" $f $f)) }}
{{- $f = printf "/layouts/partials/%s.%s" $base $suffix }} {{- $f = printf "/layouts/partials/%s.%s" $base $suffix }}
{{- if partialCached "fileExists.hugo" $f $f }} {{- if partialCached "fileExists.hugo" $f $f }}
{{- partial (printf "%s.%s" $base $suffix) $parameter }} {{- partial (printf "%s.%s" $base $suffix) $parameter }}
{{- end }} {{- end }}
{{- else }} {{- else }}
{{- partial (printf "%s.%s.%s" $base $format $suffix) $parameter }} {{- partial (printf "%s.%s.%s" $base $outputFormat $suffix) $parameter }}
{{- end }} {{- end }}