Move cover to partial; need to verify that old behavior still works as intended.
This commit is contained in:
parent
61980c49d1
commit
67bb5735de
@ -39,17 +39,8 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
{{- $cover := false -}}
|
{{ partial "cover.html" . }}
|
||||||
{{- $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,17 +29,8 @@
|
|||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partial "cover.html" . }}
|
||||||
|
|
||||||
{{- $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 }}
|
||||||
|
@ -20,17 +20,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ partial "cover.html" . }}
|
||||||
{{- $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 }}
|
{{ if .Params.Toc }}
|
||||||
<div class="table-of-contents">
|
<div class="table-of-contents">
|
||||||
|
15
layouts/partials/cover.html
Normal file
15
layouts/partials/cover.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{{- $cover := false -}}
|
||||||
|
{{- $autoCover := default $.Site.Params.autoCover false }}
|
||||||
|
{{- if $autoCover -}}
|
||||||
|
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
|
||||||
|
{{- else if .Params.Cover -}}
|
||||||
|
{{- if .Resources.GetMatch .Params.Cover }}
|
||||||
|
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $cover = absURL .Params.Cover -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{if $cover -}}
|
||||||
|
<!-- Cover image found -->
|
||||||
|
<img src="{{ $cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}" />
|
||||||
|
{{- end }}
|
Loading…
Reference in New Issue
Block a user