fix logic for getting cover information
This commit is contained in:
parent
2383eeb774
commit
ef0c8fef68
@ -1,13 +1,17 @@
|
|||||||
{{- $cover := false -}}
|
{{- $cover := false -}}
|
||||||
{{- $autoCover := default $.Site.Params.autoCover false }}
|
{{- $autoCover := default $.Site.Params.autoCover false }}
|
||||||
{{- if $autoCover -}}
|
{{- if index .Params "cover" -}}
|
||||||
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
|
|
||||||
{{- else if .Params.Cover -}}
|
|
||||||
{{- if .Resources.GetMatch .Params.Cover }}
|
{{- if .Resources.GetMatch .Params.Cover }}
|
||||||
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
|
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $cover = absURL .Params.Cover -}}
|
{{- $cover = absURL .Params.Cover -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- else if $.Site.Params.AutoCover -}}
|
||||||
|
{{- if and ( index .Params "cover" ) (not .Params.Cover) -}}
|
||||||
|
{{- if .Resources.GetMatch "cover.*" -}}
|
||||||
|
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{if $cover -}}
|
{{if $cover -}}
|
||||||
<!-- Cover image found -->
|
<!-- Cover image found -->
|
||||||
|
Loading…
Reference in New Issue
Block a user