Use Page Bundles, automatically use cover file if available.
This commit is contained in:
parent
aaaadafec9
commit
61980c49d1
@ -38,9 +38,18 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
|
||||
{{ end }}
|
||||
|
||||
{{- $cover := false -}}
|
||||
{{- $autoCover := default $.Site.Params.autoCover false }}
|
||||
{{- if $autoCover -}}
|
||||
{{- $cover = .Resources.GetMatch "cover.*" -}}
|
||||
{{- else if .Params.Cover -}}
|
||||
{{- if .Resources.GetMatch .Params.Cover }}
|
||||
{{ $cover = .Resources.GetMatch .Params.Cover }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{if $cover -}} <img src="{{ $cover.Permalink }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />{{- end }}
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.showFullContent }}
|
||||
|
@ -29,9 +29,17 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
|
||||
{{ end }}
|
||||
|
||||
{{- $cover := false -}}
|
||||
{{- $autoCover := default $.Site.Params.autoCover false }}
|
||||
{{- if $autoCover -}}
|
||||
{{- $cover = .Resources.GetMatch "cover.*" -}}
|
||||
{{- else if .Params.Cover -}}
|
||||
{{- if .Resources.GetMatch .Params.Cover }}
|
||||
{{ $cover = .Resources.GetMatch .Params.Cover }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{if $cover -}} <img src="{{ $cover.Permalink }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />{{- end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if .Params.showFullContent }}
|
||||
|
@ -21,9 +21,16 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.Cover }}
|
||||
<img src="{{ .Params.Cover | absURL }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
|
||||
{{ end }}
|
||||
{{- $cover := false -}}
|
||||
{{- $autoCover := default $.Site.Params.autoCover false }}
|
||||
{{- if $autoCover -}}
|
||||
{{- $cover = .Resources.GetMatch "cover.*" -}}
|
||||
{{- else if .Params.Cover -}}
|
||||
{{- if .Resources.GetMatch .Params.Cover }}
|
||||
{{ $cover = .Resources.GetMatch .Params.Cover }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{if $cover -}} <img src="{{ $cover.Permalink }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />{{- end }}
|
||||
|
||||
{{ if .Params.Toc }}
|
||||
<div class="table-of-contents">
|
||||
|
Loading…
Reference in New Issue
Block a user