fix(featuredImage): featuredImagePreview doesn't work by itself

This commit is contained in:
Dillon 2020-05-12 22:51:48 +08:00
parent 7c4962e39a
commit 6aa05a7f3e

View file

@ -1,11 +1,10 @@
{{- $params := .Params | merge .Site.Params.page -}} {{- $params := .Params | merge .Site.Params.page -}}
<article class="single summary" itemscope itemtype="http://schema.org/Article"> <article class="single summary" itemscope itemtype="http://schema.org/Article">
{{- /* Featured image */ -}} {{- /* Featured image */ -}}
{{- with $params.featuredimage -}} {{- with $params.featuredimagepreview | default $params.featuredimage -}}
<div class="featured-image-preview"> <div class="featured-image-preview">
<a href="{{ $.RelPermalink }}"> <a href="{{ $.RelPermalink }}">
{{- $image := $params.featuredimagepreview | default . -}} {{- dict "src" . "alt" $.Description "large" true | partial "plugin/image.html" -}}
{{- dict "src" $image "alt" $.Description "large" true | partial "plugin/image.html" -}}
</a> </a>
</div> </div>
{{- end -}} {{- end -}}