From 68166bac4ab4b79c76691ff64dfa7ae0e3b8dbea Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 10 Nov 2018 17:42:05 +0000 Subject: [PATCH] feat(page): support preview_only in combination with header image Enables use of featured image for thumbnails only with a full-width header image `[header]` shown on the page itself. See https://github.com/gcushen/hugo-academic/issues/728#issuecomment-436225586 See https://sourcethemes.com/academic/docs/managing-content/#featured-image See #728 --- layouts/partials/page_header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/page_header.html b/layouts/partials/page_header.html index f80e84c0..66428dfe 100644 --- a/layouts/partials/page_header.html +++ b/layouts/partials/page_header.html @@ -15,7 +15,7 @@ {{end}} {{/* Header image */}} -{{ if and .Params.header.image (not $featured) }} +{{ if and .Params.header.image (not (and $featured (not .Params.image.preview_only))) }}
{{ $img_src := urls.Parse .Params.header.image }} {{ if $img_src.Scheme }} @@ -29,7 +29,7 @@ {{end}} {{/* Featured image */}} -{{ if and $featured (not $.Params.image.preview_only) }} +{{ if and $featured (not .Params.image.preview_only) }} {{ $image := $featured.Fill (printf "1600x400 q90 %s" $anchor) }}