diff options
author | Wang Chucheng <wangchucheng@outlook.com> | 2020-12-17 14:05:06 +0300 |
---|---|---|
committer | Wang Chucheng <wangchucheng@outlook.com> | 2020-12-17 14:05:06 +0300 |
commit | 8f5a4d0c1aed9935e18fb0c5861cb3500d48d6a7 (patch) | |
tree | 29ae70f02ff8e187c683067f775120800aaaccf5 | |
parent | f1e1ec9f79295532a85b59c075e2ebac55951bd7 (diff) |
fix: empty featured placeholder
-rw-r--r-- | layouts/partials/get_featured.html | 8 | ||||
-rw-r--r-- | 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 f9fd419..aa99e78 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 }} -<img src="{{ $image }}" class="w-full" alt="Featured Image"> -{{ end }}
\ No newline at end of file +{{ $featured = print "<img src=\"" $image "\" class=\"w-full\" alt=\"Featured Image\">" | 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 cdd4eaf..d95cb52 100644 --- a/layouts/partials/horizontal_summary.html +++ b/layouts/partials/horizontal_summary.html @@ -1,5 +1,6 @@ <div class="flex flex-col-reverse lg:flex-row justify-between"> - <div class="w-full lg:w-2/3"> + {{ $featured := partial "get_featured" . }} + <div class="w-full {{ with $featured }}lg:w-2/3{{ end }}"> <div class="my-2"> <div class="mb-4"> <a href="{{ .Permalink }}" class="font-bold text-xl hover:text-eureka">{{ .LinkTitle }}</a> @@ -33,7 +34,7 @@ {{ partial "post_metadata.html" . }} {{ end }} </div> - {{ $featured := partial "get_featured" . }} + {{ with $featured }} <div class="w-full lg:w-1/3 mb-4 lg:mb-0 lg:ml-8"> {{ . }} |