mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: cache output-suffix #380
This commit is contained in:
parent
a425a0680c
commit
dbb37a29a8
1 changed files with 5 additions and 5 deletions
|
@ -1,14 +1,14 @@
|
|||
{{- $base := .base }}
|
||||
{{- $page := .page }}
|
||||
{{- $parameter := .parameter }}
|
||||
{{- $format := partial "output-format.hugo" $page }}
|
||||
{{- $suffix := partial "output-suffix.hugo" $page }}
|
||||
{{- $f := printf "/layouts/partials/%s.%s.%s" $base $format $suffix }}
|
||||
{{- if or (not $format) (not (partialCached "fileExists.hugo" $f $f)) }}
|
||||
{{- $outputFormat := partial "output-format.hugo" $page }}
|
||||
{{- $suffix := partialCached "output-suffix.hugo" $page $page $outputFormat }}
|
||||
{{- $f := printf "/layouts/partials/%s.%s.%s" $base $outputFormat $suffix }}
|
||||
{{- if or (not $outputFormat) (not (partialCached "fileExists.hugo" $f $f)) }}
|
||||
{{- $f = printf "/layouts/partials/%s.%s" $base $suffix }}
|
||||
{{- if partialCached "fileExists.hugo" $f $f }}
|
||||
{{- partial (printf "%s.%s" $base $suffix) $parameter }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- partial (printf "%s.%s.%s" $base $format $suffix) $parameter }}
|
||||
{{- partial (printf "%s.%s.%s" $base $outputFormat $suffix) $parameter }}
|
||||
{{- end }}
|
Loading…
Reference in a new issue