mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-05-03 23:08:48 +08:00
theme: cache output-suffix #380
This commit is contained in:
parent
a425a0680c
commit
dbb37a29a8
@ -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…
x
Reference in New Issue
Block a user