diff --git a/wowchemy/assets/scss/wowchemy/elements/_content.scss b/wowchemy/assets/scss/wowchemy/elements/_content.scss index 5a0048f4..b9882822 100644 --- a/wowchemy/assets/scss/wowchemy/elements/_content.scss +++ b/wowchemy/assets/scss/wowchemy/elements/_content.scss @@ -25,7 +25,12 @@ .article-banner { width: 100%; - height: auto; + height: 260px; + object-fit: cover; + + @include media-breakpoint-up(lg) { + height: 310px; /* Increased height on desktop */ + } } .featured-image-wrapper { diff --git a/wowchemy/layouts/partials/book_layout.html b/wowchemy/layouts/partials/book_layout.html index 1224a735..fe5e9d30 100644 --- a/wowchemy/layouts/partials/book_layout.html +++ b/wowchemy/layouts/partials/book_layout.html @@ -32,7 +32,33 @@ {{ if $show_breadcrumb }} {{ partial "components/breadcrumb" $current_page }} {{ end }} + + {{/* Cover image */}} + {{ if and .Params.cover.image }} +
+ {{- $img := "" -}} + {{ $alt := (.Params.cover.caption | default "") | plainify }} + {{ $destination := .Params.cover.image }} + {{ $is_remote := strings.HasPrefix $destination "http" }} + {{- if not $is_remote -}} + {{- $img = (.Page.Resources.ByType "image").GetMatch $destination -}} + {{- if not $img -}} + {{- $img = resources.Get (path.Join "media" $destination) -}} + {{- end -}} + {{- end -}} + {{ if $img }} + {{ $img = $img.Fit "1800x310 webp" }} + {{$alt}} + {{ else }} + {{$alt}} + {{ end }} + + {{ with .Params.cover.caption }}{{ . | markdownify | emojify }}{{ end }} +
+ {{end}} + +

{{ .Title }}