mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 00:14:05 +00:00
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
This commit is contained in:
1 parent
3b4616e357
commit
68166bac4a
1 file changed
+2
-2
@@ -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))) }}
|
||||
<div class="article-header">
|
||||
{{ $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) }}
|
||||
<div class="article-header d-xl-none">
|
||||
<img src="{{ $image.RelPermalink }}" class="article-banner" itemprop="image" alt="">
|
||||
|
||||
Reference in new issue
Block a user