diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 026954c7..dd915162 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,10 @@ {{ define "main" }} {{ .Scratch.Set "scope" "single" }} +
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }} diff --git a/layouts/partials/article-link/simple.html b/layouts/partials/article-link/simple.html index 8c994825..b0c423b0 100644 --- a/layouts/partials/article-link/simple.html +++ b/layouts/partials/article-link/simple.html @@ -40,6 +40,8 @@ {{- $images := $.Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{- $url:= .Params.featureimage -}} + {{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} {{- with $featured -}} diff --git a/layouts/partials/hero/background.html b/layouts/partials/hero/background.html index ec3a9db9..0ce96d59 100644 --- a/layouts/partials/hero/background.html +++ b/layouts/partials/hero/background.html @@ -4,6 +4,9 @@ {{- $featured := $images.GetMatch "*background*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "*feature*" }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- $url:= .Params.featureimage -}} +{{if or $.Site.Params.list.showHero $.Site.Params.term.showHero $.Site.Params.taxonomy.showHero}} {{ $url = default $.Site.Params.homepage.homepageImage $.Site.Params.defaultBackgroundImage }} {{end}} +{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{- if not $featured }}{{ with .Site.Params.defaultBackgroundImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{ $isParentList := eq (.Scratch.Get "scope") "list" }} {{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or diff --git a/layouts/partials/hero/big.html b/layouts/partials/hero/big.html index cbdce5d5..89bb1759 100644 --- a/layouts/partials/hero/big.html +++ b/layouts/partials/hero/big.html @@ -3,16 +3,25 @@ {{- $images := .Resources.ByType "image" -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- $url:= .Params.featureimage -}} +{{- $caption:= .Params.featureimagecaption -}} +{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{- $alt := .Page.Title -}} {{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}} {{- with $featured -}} {{ if $disableImageOptimization }} {{ with . }} - {{ $alt }} +
+ {{ $alt }} +
{{ $caption | markdownify }}
+
{{ end }} {{ else }} {{ with .Resize "1200x" }} - {{ $alt }} +
+ {{ $alt }} +
{{ $caption | markdownify }}
+
{{ end }} {{ end }} {{- end -}} \ No newline at end of file diff --git a/layouts/partials/hero/thumbAndBackground.html b/layouts/partials/hero/thumbAndBackground.html index 1e4114ca..7704345d 100644 --- a/layouts/partials/hero/thumbAndBackground.html +++ b/layouts/partials/hero/thumbAndBackground.html @@ -7,6 +7,8 @@ {{- if not $background }}{{ $background = $images.GetMatch "*feature*" }}{{ end -}} {{- $featured := $images.GetMatch "*feature*" -}} {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- $url:= .Params.featureimage -}} +{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} {{- if not $featured }}{{ $featured = $images.GetMatch "*background*" }}{{ end -}} {{- if not $featured }}{{ with .Site.Params.defaultBackgroundImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} {{ $isParentList := eq (.Scratch.Get "scope") "list" }} diff --git a/layouts/partials/home/background.html b/layouts/partials/home/background.html index c5e9ea81..66af2cb8 100644 --- a/layouts/partials/home/background.html +++ b/layouts/partials/home/background.html @@ -6,8 +6,8 @@
{{ $homepageImage := "" }} - {{ with .Site.Params.defaultBackgroundImage }}{{ $homepageImage = resources.Get . }}{{ end }} - {{ with .Site.Params.homepage.homepageImage }}{{ $homepageImage = resources.Get . }}{{ end }} + {{ with .Site.Params.defaultBackgroundImage }} {{ $homepageImage = resources.Get . }} {{if not $homepageImage}} {{ $homepageImage = resources.GetRemote . }} {{ end }} {{ end }} + {{ with .Site.Params.homepage.homepageImage }} {{ $homepageImage = resources.Get . }} {{if not $homepageImage}} {{ $homepageImage = resources.GetRemote . }} {{ end }} {{ end }} {{ if not (eq $homepageImage "") }}