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