From 8f5a4d0c1aed9935e18fb0c5861cb3500d48d6a7 Mon Sep 17 00:00:00 2001 From: Wang Chucheng Date: Thu, 17 Dec 2020 19:05:06 +0800 Subject: [PATCH] fix: empty featured placeholder --- layouts/partials/get_featured.html | 8 +++++--- layouts/partials/horizontal_summary.html | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/layouts/partials/get_featured.html b/layouts/partials/get_featured.html index f9fd419c..aa99e78f 100644 --- a/layouts/partials/get_featured.html +++ b/layouts/partials/get_featured.html @@ -1,7 +1,9 @@ {{ $video := partial "get_video" (dict "context" . "url" .Params.featuredVideo "keyword" "*featured*") }} {{ $image := partial "get_image.html" (dict "context" . "url" .Params.featuredImage "keyword" "*featured*") }} +{{ $featured := ""}} {{ if $video }} -{{ $video }} +{{ $featured = $video }} {{ else if $image }} -Featured Image -{{ end }} \ No newline at end of file +{{ $featured = print "\"Featured" | safeHTML }} +{{ end }} +{{ return $featured }} \ No newline at end of file diff --git a/layouts/partials/horizontal_summary.html b/layouts/partials/horizontal_summary.html index cdd4eaf9..d95cb526 100644 --- a/layouts/partials/horizontal_summary.html +++ b/layouts/partials/horizontal_summary.html @@ -1,5 +1,6 @@
-
+ {{ $featured := partial "get_featured" . }} +
{{ .LinkTitle }} @@ -33,7 +34,7 @@ {{ partial "post_metadata.html" . }} {{ end }}
- {{ $featured := partial "get_featured" . }} + {{ with $featured }}
{{ . }}